Codechange: Add a priority field to TimerGameTick::TPeriod

Use this as the primary sort key for TimerGameTick::TPeriod,
to avoid container sort order changes on timer period saveload.
See: #12509
This commit is contained in:
Jonathan G Rennison
2024-04-20 15:39:36 +01:00
committed by rubidium42
parent 57f5d27427
commit 11ec156b64
8 changed files with 53 additions and 17 deletions

View File

@@ -3255,7 +3255,7 @@ bool AfterLoadGame()
/* We did load the "period" of the timer, but not the fired/elapsed. We can deduce that here. */
extern TimeoutTimer<TimerGameTick> _new_competitor_timeout;
_new_competitor_timeout.storage.elapsed = 0;
_new_competitor_timeout.fired = _new_competitor_timeout.period == 0;
_new_competitor_timeout.fired = _new_competitor_timeout.period.value == 0;
}
if (IsSavegameVersionBefore(SLV_NEWGRF_LAST_SERVICE)) {