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:
@@ -806,10 +806,13 @@ bool AfterLoadGame()
|
||||
if (SlXvIsFeatureMissing(XSLFI_VARIABLE_DAY_LENGTH) && SlXvIsFeatureMissing(XSLFI_SPRINGPP) && SlXvIsFeatureMissing(XSLFI_JOKERPP) && SlXvIsFeatureMissing(XSLFI_CHILLPP)) {
|
||||
_settings_game.economy.day_length_factor = 1;
|
||||
}
|
||||
if (SlXvIsFeatureMissing(XSLFI_VARIABLE_DAY_LENGTH, 3)) {
|
||||
_scaled_tick_counter = (uint64)((_tick_counter * _settings_game.economy.day_length_factor) + _tick_skip_counter);
|
||||
}
|
||||
|
||||
/* Update current year
|
||||
* must be done before loading sprites as some newgrfs check it */
|
||||
SetDate(_date, _date_fract);
|
||||
SetDate(_date, _date_fract, false);
|
||||
|
||||
/*
|
||||
* Force the old behaviour for compatibility reasons with old savegames. As new
|
||||
|
Reference in New Issue
Block a user