diff options
author | glx <glx@openttd.org> | 2020-05-06 22:44:47 +0200 |
---|---|---|
committer | glx22 <glx22@users.noreply.github.com> | 2020-05-06 23:12:59 +0200 |
commit | bc8333723ccf0ea5e889a6bc412c89ea623138bc (patch) | |
tree | 597d64290fa30fba189479332c2d29465f1b274f /src/saveload | |
parent | 64278fd5983c80757615d67c76922e700246fc1b (diff) | |
download | openttd-bc8333723ccf0ea5e889a6bc412c89ea623138bc.tar.xz |
Fix #8021: limit savegame range for docking tiles fixing
Diffstat (limited to 'src/saveload')
-rw-r--r-- | src/saveload/afterload.cpp | 11 | ||||
-rw-r--r-- | src/saveload/saveload_internal.h | 1 | ||||
-rw-r--r-- | src/saveload/station_sl.cpp | 11 |
3 files changed, 8 insertions, 15 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 0f1d4c450..b81d446e4 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -3120,6 +3120,14 @@ bool AfterLoadGame() } if (IsSavegameVersionUntil(SLV_ENDING_YEAR)) { + /* Update station docking tiles. Was only needed for pre-SLV_MULTITLE_DOCKS + * savegames, but a bug in docking tiles touched all savegames between + * SLV_MULTITILE_DOCKS and SLV_ENDING_YEAR. */ + for (Station *st : Station::Iterate()) { + if (st->ship_station.tile != INVALID_TILE) UpdateStationDockingTiles(st); + } + + /* Reset roadtype/streetcartype info for non-road bridges. */ for (TileIndex t = 0; t < map_size; t++) { if (IsTileType(t, MP_TUNNELBRIDGE) && GetTunnelBridgeTransportType(t) != TRANSPORT_ROAD) { SetRoadTypes(t, INVALID_ROADTYPE, INVALID_ROADTYPE); @@ -3127,9 +3135,6 @@ bool AfterLoadGame() } } - /* 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 69dfb5dbf..8a3f433c2 100644 --- a/src/saveload/saveload_internal.h +++ b/src/saveload/saveload_internal.h @@ -29,7 +29,6 @@ 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 b0e91b4e7..1d3612ae3 100644 --- a/src/saveload/station_sl.cpp +++ b/src/saveload/station_sl.cpp @@ -141,17 +141,6 @@ 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), |