From 75ea449ea19df08c6d49951b47b2d948a11967c7 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 27 Dec 2024 13:12:02 +0000 Subject: [PATCH] Fix: Rail station tile flags were not set early enough. Rail station tile flags now use bits that were (long ago) used to store railtype. During Afterload, there are some calls that need the state of station tile flags to be correct which were executed before the station tile flags were set. --- src/saveload/afterload.cpp | 8 -------- src/saveload/station_sl.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 1782d052b2..f1a204d027 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -2920,14 +2920,6 @@ bool AfterLoadGame() } } - { - /* Station blocked, wires and pylon flags need to be stored in the map. This is effectively cached data, so no - * version check is necessary. This is done here as the SLV_182 check below needs the blocked status. */ - for (const auto t : Map::Iterate()) { - if (HasStationTileRail(t)) SetRailStationTileFlags(t, GetStationSpec(t)); - } - } - if (IsSavegameVersionBefore(SLV_182)) { /* Aircraft acceleration variable was bonkers */ for (Aircraft *v : Aircraft::Iterate()) { diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp index b724e423b9..c9932cae6f 100644 --- a/src/saveload/station_sl.cpp +++ b/src/saveload/station_sl.cpp @@ -130,6 +130,12 @@ void AfterLoadStations() StationUpdateCachedTriggers(st); RoadStopUpdateCachedTriggers(st); } + + /* Station blocked, wires and pylon flags need to be stored in the map. This is effectively cached data, so no + * version check is necessary. */ + for (const auto t : Map::Iterate()) { + if (HasStationTileRail(t)) SetRailStationTileFlags(t, GetStationSpec(t)); + } } /**