Advance _scaled_date_ticks in scenario editor

For timetables and train speed adaptation
This commit is contained in:
Jonathan G Rennison
2024-01-27 16:48:00 +00:00
parent 7db457ad80
commit 2e93daf93b

View File

@@ -2113,6 +2113,15 @@ void StateGameLoop()
if (_game_mode == GM_EDITOR) {
BasePersistentStorageArray::SwitchMode(PSM_ENTER_GAMELOOP);
/* _scaled_date_ticks and _scaled_date_ticks_offset must update in lockstep here,
* as _date, _tick_skip_counter, etc are not updated in the scenario editor,
* but _scaled_date_ticks should still update in case there are vehicles running,
* to avoid problems with timetables and train speed adaptation
*/
_scaled_date_ticks++;
_scaled_date_ticks_offset++;
RunTileLoop();
CallVehicleTicks();
CallLandscapeTick();