diff options
author | SamuXarick <43006711+SamuXarick@users.noreply.github.com> | 2020-02-24 22:49:11 +0000 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2020-03-30 08:21:40 +0200 |
commit | 57553cd8098ac003b3d5df6b9778214e6933c5d7 (patch) | |
tree | 93c0fbeadf0c67d2aeea891503b5a7007b50d7ed /src/saveload | |
parent | 4d4005d8b7455fba8fe4e59dc99727a4caec6edf (diff) | |
download | openttd-57553cd8098ac003b3d5df6b9778214e6933c5d7.tar.xz |
Fix #8020: Add missing docking tiles around industry neutral stations
Diffstat (limited to 'src/saveload')
-rw-r--r-- | src/saveload/afterload.cpp | 8 | ||||
-rw-r--r-- | src/saveload/saveload_internal.h | 1 | ||||
-rw-r--r-- | src/saveload/station_sl.cpp | 11 |
3 files changed, 15 insertions, 5 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 022fd28e9..63e4b37e6 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -3116,13 +3116,11 @@ bool AfterLoadGame() if (IsDock(t) || IsOilRig(t)) Station::GetByTile(t)->ship_station.Add(t); } } - - /* Scan for docking tiles */ - for (Station *st : Station::Iterate()) { - if (st->ship_station.tile != INVALID_TILE) UpdateStationDockingTiles(st); - } } + /* Update station docking tiles. */ + AfterLoadScanDockingTiles(); + /* Compute station catchment areas. This is needed here in case UpdateStationAcceptance is called below. */ Station::RecomputeCatchmentForAll(); diff --git a/src/saveload/saveload_internal.h b/src/saveload/saveload_internal.h index 8a3f433c2..69dfb5dbf 100644 --- a/src/saveload/saveload_internal.h +++ b/src/saveload/saveload_internal.h @@ -29,6 +29,7 @@ void AfterLoadVehicles(bool part_of_load); void FixupTrainLengths(); void AfterLoadStations(); void AfterLoadRoadStops(); +void AfterLoadScanDockingTiles(); void ResetLabelMaps(); void AfterLoadLabelMaps(); void AfterLoadStoryBook(); diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp index 1d3612ae3..b0e91b4e7 100644 --- a/src/saveload/station_sl.cpp +++ b/src/saveload/station_sl.cpp @@ -141,6 +141,17 @@ void AfterLoadRoadStops() } } +/** + * (Re)scan for station docking tiles after loading a savegame. + */ +void AfterLoadScanDockingTiles() +{ + /* Scan for docking tiles */ + for (Station *st : Station::Iterate()) { + if (st->ship_station.tile != INVALID_TILE) UpdateStationDockingTiles(st); + } +} + static const SaveLoad _roadstop_desc[] = { SLE_VAR(RoadStop, xy, SLE_UINT32), SLE_CONDNULL(1, SL_MIN_VERSION, SLV_45), |