Fix: Use correct 'minutes per year' setting for old savegames (#14995)

This commit is contained in:
Tyler Trahan
2025-12-27 13:59:28 -05:00
committed by dP
parent 39e362b211
commit 9c137ca774

View File

@@ -779,6 +779,9 @@ bool AfterLoadGame()
/* Only new games can use wallclock units. */
if (IsSavegameVersionBefore(SLV_ECONOMY_MODE_TIMEKEEPING_UNITS)) _settings_game.economy.timekeeping_units = TKU_CALENDAR;
/* Set the correct default for 'minutes per year' if the savegame was created before the setting existed. */
if (IsSavegameVersionBefore(SLV_CALENDAR_SUB_DATE_FRACT)) _settings_game.economy.minutes_per_calendar_year = CalendarTime::DEF_MINUTES_PER_YEAR;
/* Update economy year. If we don't have a separate economy date saved, follow the calendar date. */
if (IsSavegameVersionBefore(SLV_ECONOMY_DATE)) {
TimerGameEconomy::SetDate(TimerGameEconomy::Date{TimerGameCalendar::date.base()}, TimerGameCalendar::date_fract);