diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 7d35115357..429691286e 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -11,6 +11,7 @@ - Fix: [#5629] Issue with tower ride modes approach to station - incorrect sum caused sawtooth in velocity - Fix: [#5768] Prevent loading non-existent title sequences. - Fix: [#5858] Crash when using custom ride with no colour presets. +- Fix: [#5865] Ride preview flickering on uneven terrain or mid air. - Fix: [#5872] Incorrect OpenGL rendering of masked sprites - Fix: [#5880] Leaving bumper cars without building causes assertion. - Fix: [#5912] Negative queue when moving entrance in paused state. diff --git a/src/openrct2/game.c b/src/openrct2/game.c index 3e0bd02642..bd8283d266 100644 --- a/src/openrct2/game.c +++ b/src/openrct2/game.c @@ -284,7 +284,7 @@ void game_update() { gInUpdateCode = true; - sint32 i, numUpdates; + sint32 numUpdates; // 0x006E3AEC // screen_game_process_mouse_input(); screenshot_check(); @@ -317,6 +317,25 @@ void game_update() network_process_game_commands(); } + // Update the game one or more times + for (sint32 i = 0; i < numUpdates; i++) { + game_logic_update(); + + if (gGameSpeed > 1) + continue; + + if (input_get_state() == INPUT_STATE_RESET || + input_get_state() == INPUT_STATE_NORMAL + ) { + if (input_test_flag(INPUT_FLAG_VIEWPORT_SCROLLING)) { + input_set_flag(INPUT_FLAG_VIEWPORT_SCROLLING, false); + break; + } + } else { + break; + } + } + if (!gOpenRCT2Headless) { input_set_flag(INPUT_FLAG_VIEWPORT_SCROLLING, false); @@ -347,25 +366,6 @@ void game_update() game_handle_input(); } - // Update the game one or more times - for (i = 0; i < numUpdates; i++) { - game_logic_update(); - - if (gGameSpeed > 1) - continue; - - if (input_get_state() == INPUT_STATE_RESET || - input_get_state() == INPUT_STATE_NORMAL - ) { - if (input_test_flag(INPUT_FLAG_VIEWPORT_SCROLLING)) { - input_set_flag(INPUT_FLAG_VIEWPORT_SCROLLING, false); - break; - } - } else { - break; - } - } - // Always perform autosave check, even when paused if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) && !(gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) &&