summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-01-08 23:28:46 +0100
committerGitHub <noreply@github.com>2021-01-08 23:28:46 +0100
commitb6ac5a3ab9d2dcb9496ad16973bca14ec495fa31 (patch)
tree6f7eb248130b6191c2e976dba3387e3bf8ac674c /src
parent5f591c86fe0d49f18da12515facc884269497b08 (diff)
downloadopenttd-b6ac5a3ab9d2dcb9496ad16973bca14ec495fa31.tar.xz
Fix 85a49a0d3: hotkeys were enabled outside of GM_NORMAL (#8534)
Diffstat (limited to 'src')
-rw-r--r--src/airport_gui.cpp1
-rw-r--r--src/rail_gui.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp
index e12b8dccb..0697c2443 100644
--- a/src/airport_gui.cpp
+++ b/src/airport_gui.cpp
@@ -172,6 +172,7 @@ struct BuildAirToolbarWindow : Window {
*/
static EventState AirportToolbarGlobalHotkeys(int hotkey)
{
+ if (_game_mode != GM_NORMAL) return ES_NOT_HANDLED;
Window *w = ShowBuildAirToolbar();
if (w == nullptr) return ES_NOT_HANDLED;
return w->OnHotkey(hotkey);
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index 37c365881..77792f276 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -769,6 +769,7 @@ struct BuildRailToolbarWindow : Window {
*/
static EventState RailToolbarGlobalHotkeys(int hotkey)
{
+ if (_game_mode != GM_NORMAL) return ES_NOT_HANDLED;
extern RailType _last_built_railtype;
Window *w = ShowBuildRailToolbar(_last_built_railtype);
if (w == nullptr) return ES_NOT_HANDLED;