From 8ea6c6abdff8c3c0d61e596ef88316331b3714fa Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 18 Sep 2024 00:03:48 +0100 Subject: [PATCH] Fix: Crash when pressing arrow keys in bootstrap mode See: #12808 --- src/window.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/window.cpp b/src/window.cpp index 9f215d4593..64c96d16aa 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -2761,8 +2761,10 @@ static void HandleKeyScrolling() if (_dirkeys && !EditBoxInGlobalFocus()) { int factor = _shift_pressed ? 50 : 10; - /* Key scrolling stops following a vehicle. */ - GetMainWindow()->viewport->follow_vehicle = INVALID_VEHICLE; + if (_game_mode != GM_MENU && _game_mode != GM_BOOTSTRAP) { + /* Key scrolling stops following a vehicle. */ + GetMainWindow()->viewport->follow_vehicle = INVALID_VEHICLE; + } ScrollMainViewport(scrollamt[_dirkeys][0] * factor, scrollamt[_dirkeys][1] * factor); }