1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 17:32:45 +01:00

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 GitHub
parent 42cffe0e16
commit eaa066990e

View File

@@ -735,6 +735,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);