Reset day length factor to 1 when loading pre day length savegame

This commit is contained in:
Jonathan G Rennison
2017-03-05 15:25:34 +00:00
parent 11906f24c5
commit 1f148322fb

View File

@@ -694,6 +694,11 @@ bool AfterLoadGame()
/* The value of _date_fract got divided, so make sure that old games are converted correctly. */ /* The value of _date_fract got divided, so make sure that old games are converted correctly. */
if (IsSavegameVersionBefore(11, 1) || (IsSavegameVersionBefore(147) && _date_fract > DAY_TICKS)) _date_fract /= 885; if (IsSavegameVersionBefore(11, 1) || (IsSavegameVersionBefore(147) && _date_fract > DAY_TICKS)) _date_fract /= 885;
/* Set day length factor to 1 if loading a pre day length savegame */
if (SlXvIsFeatureMissing(XSLFI_VARIABLE_DAY_LENGTH)) {
_settings_game.economy.day_length_factor = 1;
}
/* Update current year /* Update current year
* must be done before loading sprites as some newgrfs check it */ * must be done before loading sprites as some newgrfs check it */
SetDate(_date, _date_fract); SetDate(_date, _date_fract);