From 1f148322fb1d0f2f07af080e204e94e58cb3df0f Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sun, 5 Mar 2017 15:25:34 +0000 Subject: [PATCH] Reset day length factor to 1 when loading pre day length savegame --- src/saveload/afterload.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index de3f7ccff9..a70e12b79d 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -694,6 +694,11 @@ bool AfterLoadGame() /* 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; + /* 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 * must be done before loading sprites as some newgrfs check it */ SetDate(_date, _date_fract);