diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -47,6 +47,7 @@ #include "../subsidy_base.h" #include "../subsidy_func.h" #include "../newgrf.h" +#include "../newgrf_station.h" #include "../engine_func.h" #include "../rail_gui.h" #include "../core/backup_type.hpp" @@ -2856,6 +2857,26 @@ bool AfterLoadGame() _settings_game.script.settings_profile = IsInsideMM(_old_diff_level, SP_BEGIN, SP_END) ? _old_diff_level : (uint)SP_MEDIUM; } + { + /* 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 (auto t : Map::Iterate()) { + if (HasStationTileRail(t)) { + StationGfx gfx = GetStationGfx(t); + const StationSpec *statspec = GetStationSpec(t); + + bool blocked = statspec != nullptr && HasBit(statspec->blocked, gfx); + /* Default stations do not draw pylons under roofs (gfx >= 4) */ + bool pylons = statspec != nullptr ? HasBit(statspec->pylons, gfx) : gfx < 4; + bool wires = statspec == nullptr || !HasBit(statspec->wires, gfx); + + SetStationTileBlocked(t, blocked); + SetStationTileHavePylons(t, pylons); + SetStationTileHaveWires(t, wires); + } + } + } + if (IsSavegameVersionBefore(SLV_182)) { /* Aircraft acceleration variable was bonkers */ for (Aircraft *v : Aircraft::Iterate()) {