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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user