Store state ticks directly in savegame instead of the offset

Initialise the state ticks value to a constant for new games,
instead of using an implicit offset of 0
This commit is contained in:
Jonathan G Rennison
2024-02-07 20:05:11 +00:00
parent 0ea57528c9
commit d39236d50c
10 changed files with 42 additions and 43 deletions

View File

@@ -131,6 +131,7 @@ void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settin
_tick_counter = 0;
_tick_skip_counter = 0;
_scaled_tick_counter = 0;
_state_ticks = INITIAL_STATE_TICKS_VALUE;
_state_ticks_offset = 0;
_cur_tileloop_tile = 1;
_aux_tileloop_tile = 1;
@@ -153,10 +154,10 @@ void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settin
_newgrf_profilers.clear();
if (reset_date) {
SetDate(ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1), 0, false);
SetDate(ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1), 0);
InitializeOldNames();
} else {
SetScaledTickVariables();
RecalculateStateTicksOffset();
}
SetupTileLoopCounts();
UpdateCargoScalers();