From f4c31438efc334d521fe36bfe795cc3b8158427d Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 15 Oct 2026 11:01:54 +0200 Subject: [PATCH 1/3] up/down keys now do something in NumberQuestion --- FeLib/Source/feio.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/FeLib/Source/feio.cpp b/FeLib/Source/feio.cpp index 0e80a90ee..796050b40 100644 --- a/FeLib/Source/feio.cpp +++ b/FeLib/Source/feio.cpp @@ -633,6 +633,13 @@ int iosystem::StringQuestion(festring& Input, return NORMAL_EXIT; } +/* by how many do a subsequent up/down Presses increase the value in NumberQuestion */ +static int clickval(int a) { + int click_values[] = {0, 1, 2, 3, 4, 5, 7, 10, 15, 20, 30, 40, 50, 60, 80}; + if(a < 14) return click_values[a]; + return clickval(a-8) * 10; + } + /* Ask a question defined by Topic. This function only accepts numbers. The question is drawn to coordinates given by Pos. All fonts are Color colored. If Fade is true the question is asked on a black background @@ -642,6 +649,7 @@ long iosystem::NumberQuestion(cfestring& Topic, v2 Pos, col16 Color, truth Fade, truth ReturnZeroOnEsc) { bInUse=true; + int last_direction = 0, clicks = 0; v2 V(RES.X, 10); ///??????????? bitmap BackUp(V, 0); @@ -682,9 +690,12 @@ long iosystem::NumberQuestion(cfestring& Topic, v2 Pos, col16 Color, && LastKey != KEY_ENTER && LastKey != KEY_ESC && LastKey != KEY_HOME && LastKey != KEY_END && LastKey != KEY_LEFT && LastKey != KEY_RIGHT + && LastKey != KEY_UP && LastKey != KEY_DOWN && LastKey != KEY_CONTROLLER_A && LastKey != KEY_CONTROLLER_B - && (LastKey != '-' || !Input.IsEmpty())) + && (LastKey != '-' || !Input.IsEmpty())) { LastKey = GET_KEY(false); + if(LastKey != KEY_UP && LastKey != KEY_DOWN) clicks = 0; + } if(LastKey == KEY_BACK_SPACE) { @@ -729,6 +740,20 @@ long iosystem::NumberQuestion(cfestring& Topic, v2 Pos, col16 Color, continue; } + if(LastKey == KEY_UP || LastKey == KEY_DOWN) + { + if(last_direction != LastKey) + { + last_direction = LastKey; + clicks = 0; + } + int current = atoi(Input.CStr()); + current += (LastKey == KEY_UP ? 1 : -1) * (clickval(clicks+1) - clickval(clicks)); + clicks++; + Input = ""; Input << current; + continue; + } + if(LastKey == KEY_RIGHT) { if(CursorPos < static_cast(Input.GetSize())) From 23fdde0b15cc3a9cd1b3f00d51a706d60f212c6e Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 15 Oct 2026 11:02:10 +0200 Subject: [PATCH 2/3] clicking map in the wilderness no longer crashes the game --- Main/Source/char.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Main/Source/char.cpp b/Main/Source/char.cpp index 51f454cf2..0e11f270a 100644 --- a/Main/Source/char.cpp +++ b/Main/Source/char.cpp @@ -3746,6 +3746,8 @@ void character::PerformPlayerCommand(int Key, bool& HasActed, bool& ValidKeyPres HasActed = true; } else if(v.IsAdjacent(ZERO_V2)) MoveByVector(v); + else if(game::IsInWilderness()) + ADD_MESSAGE("Auto-routing cannot be used while in wilderness."); else { ValidKeyPressed = true; HasActed = commandsystem::SpawnRoute(this, TPos); From e8863caa910b4111a5c7dabc16df7cc0ba9a4b78 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 15 Oct 2026 11:02:27 +0200 Subject: [PATCH 3/3] SpawnRoute no longer crashes if no route was found --- Main/Source/command.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Main/Source/command.cpp b/Main/Source/command.cpp index d141d4a6a..da6e8a8f2 100644 --- a/Main/Source/command.cpp +++ b/Main/Source/command.cpp @@ -1948,6 +1948,8 @@ truth commandsystem::SpawnRoute(character* Char, v2 Pos) } } + if(RouteGoOn.empty()) return false; + go* Go = go::Spawn(Char); Go->SetRoute(RouteGoOn); Go->SetDirectionFromRoute();