diff options
Diffstat (limited to 'src/saveload/station_sl.cpp')
-rw-r--r-- | src/saveload/station_sl.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp index 6c52e7cf6..a25eb556d 100644 --- a/src/saveload/station_sl.cpp +++ b/src/saveload/station_sl.cpp @@ -15,6 +15,7 @@ #include "../roadstop_base.h" #include "../vehicle_base.h" #include "../newgrf_station.h" +#include "../station_map.h" #include "saveload.h" #include "table/strings.h" @@ -108,6 +109,25 @@ void AfterLoadStations() } } +/** + * (Re)building of road stop caches after loading a savegame. + */ +void AfterLoadRoadStops() +{ + /* First construct the drive through entries */ + RoadStop *rs; + FOR_ALL_ROADSTOPS(rs) { + if (IsDriveThroughStopTile(rs->xy)) rs->MakeDriveThrough(); + } + /* And then rebuild the data in those entries */ + FOR_ALL_ROADSTOPS(rs) { + if (!HasBit(rs->status, RoadStop::RSSFB_BASE_ENTRY)) continue; + + rs->GetEntry(DIAGDIR_NE)->Rebuild(rs); + rs->GetEntry(DIAGDIR_NW)->Rebuild(rs); + } +} + static const SaveLoad _roadstop_desc[] = { SLE_VAR(RoadStop, xy, SLE_UINT32), SLE_CONDNULL(1, 0, 44), |