From 59904e5f9b2ac5a0d209fd10988e7982de933481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Mon, 10 Mar 2025 14:55:19 +0100 Subject: [PATCH] Fix #13749: Apply callback when automatically changing timekeeping unit (#13751) --- src/settings_table.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/settings_table.cpp b/src/settings_table.cpp index 0d560525e4..9df8ff8065 100644 --- a/src/settings_table.cpp +++ b/src/settings_table.cpp @@ -658,8 +658,10 @@ static void ChangeMinutesPerYear(int32_t new_value) * This can only happen in the menu, since the pre_cb ensures this setting can only be changed there, or if we're already using wallclock units. */ if (_game_mode == GM_MENU && (_settings_newgame.economy.minutes_per_calendar_year != CalendarTime::DEF_MINUTES_PER_YEAR)) { - _settings_newgame.economy.timekeeping_units = TKU_WALLCLOCK; - InvalidateWindowClassesData(WC_GAME_OPTIONS, 0); + if (_settings_newgame.economy.timekeeping_units != TKU_WALLCLOCK) { + _settings_newgame.economy.timekeeping_units = TKU_WALLCLOCK; + ChangeTimekeepingUnits(TKU_WALLCLOCK); + } } }