diff options
Diffstat (limited to 'src/saveload')
-rw-r--r-- | src/saveload/afterload.cpp | 16 | ||||
-rw-r--r-- | src/saveload/saveload.cpp | 2 | ||||
-rw-r--r-- | src/saveload/station_sl.cpp | 9 |
3 files changed, 21 insertions, 6 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 68009a727..6c82203dd 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -1882,6 +1882,22 @@ bool AfterLoadGame() } } + if (CheckSavegameVersion(124)) { + /* The train station tile area was added */ + Waypoint *wp; + FOR_ALL_WAYPOINTS(wp) { + if (wp->facilities & FACIL_TRAIN) { + wp->train_station.tile = wp->xy; + wp->train_station.w = 1; + wp->train_station.h = 1; + } else {; + wp->train_station.tile = INVALID_TILE; + wp->train_station.w = 0; + wp->train_station.h = 0; + } + } + } + AfterLoadLabelMaps(); GamelogPrintDebug(1); diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index dd44cc4cd..a541b2006 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -41,7 +41,7 @@ #include "saveload_internal.h" -extern const uint16 SAVEGAME_VERSION = 123; +extern const uint16 SAVEGAME_VERSION = 124; SavegameType _savegame_type; ///< type of savegame we are loading diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp index d8df2e734..948779d50 100644 --- a/src/saveload/station_sl.cpp +++ b/src/saveload/station_sl.cpp @@ -95,11 +95,6 @@ void AfterLoadStations() if (Station::IsExpected(st)) { for (CargoID c = 0; c < NUM_CARGO; c++) Station::From(st)->goods[c].cargo.InvalidateCache(); - } else if (st->facilities & FACIL_TRAIN) { - /* Temporary fill this variable with correct data. */ - st->train_station.tile = st->xy; - st->train_station.w = 1; - st->train_station.h = 1; } StationUpdateAnimTriggers(st); @@ -332,6 +327,10 @@ static const SaveLoad _waypoint_desc[] = { SLE_VAR(Waypoint, town_cn, SLE_UINT16), + SLE_CONDVAR(Waypoint, train_station.tile, SLE_UINT32, 124, SL_MAX_VERSION), + SLE_CONDVAR(Waypoint, train_station.w, SLE_UINT8, 124, SL_MAX_VERSION), + SLE_CONDVAR(Waypoint, train_station.h, SLE_UINT8, 124, SL_MAX_VERSION), + SLE_END() }; |