From 450c6b76d68f2281ef4739a1de20d445f3fa3776 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Fri, 16 Feb 2024 17:54:19 +0000 Subject: [PATCH] Ensure tile loop counts and cargo scalers updated when day length changed --- src/date.cpp | 3 +++ src/misc.cpp | 6 ++++-- src/settings.cpp | 3 --- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/date.cpp b/src/date.cpp index a09513e0c2..3f576ccb7f 100644 --- a/src/date.cpp +++ b/src/date.cpp @@ -123,6 +123,9 @@ void RecalculateStateTicksOffset() void UpdateEffectiveDayLengthFactor() { DateDetail::_effective_day_length = _settings_game.EffectiveDayLengthFactor(); + + SetupTileLoopCounts(); + UpdateCargoScalers(); } CalTime::Date StateTicksToCalendarDate(StateTicks ticks) diff --git a/src/misc.cpp b/src/misc.cpp index 93efc983b1..181190fc5f 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -167,8 +167,10 @@ void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settin } else { RecalculateStateTicksOffset(); } - SetupTileLoopCounts(); - UpdateCargoScalers(); + + UpdateEffectiveDayLengthFactor(); + SetupTickRate(); + UpdateCachedSnowLine(); UpdateCachedSnowLineBounds(); diff --git a/src/settings.cpp b/src/settings.cpp index 413e3b71f4..91144199be 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -2031,9 +2031,6 @@ static void DayLengthChanged(int32_t new_value) UpdateEffectiveDayLengthFactor(); RecalculateStateTicksOffset(); - SetupTileLoopCounts(); - UpdateCargoScalers(); - MarkWholeScreenDirty(); }