Changing day length or date no longer changes time in minutes

Add offset variables for scaled date ticks.
Adjust offset when changing day length or date, such that scaled
date ticks remain the same.
Store _scaled_tick_counter and scaled date ticks offset in the savagame.
This commit is contained in:
Jonathan G Rennison
2022-12-15 22:54:42 +00:00
parent 9038c849ab
commit 3877bb31ef
18 changed files with 127 additions and 48 deletions

View File

@@ -88,6 +88,8 @@ void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settin
_game_speed = 100;
_tick_counter = 0;
_tick_skip_counter = 0;
_scaled_tick_counter = 0;
_scaled_date_ticks_offset = 0;
_cur_tileloop_tile = 1;
_thd.redsq = INVALID_TILE;
_road_layout_change_counter = 0;
@@ -107,7 +109,7 @@ 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);
SetDate(ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1), 0, false);
InitializeOldNames();
} else {
SetScaledTickVariables();