From 1e3855c9c3d388d3b9643c98f1e3a072abf58336 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 18 Sep 2024 21:41:54 +0100 Subject: [PATCH] Fix: Crash when pressing arrow keys in bootstrap mode (#12948) --- 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); }