summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/afterload.cpp32
-rw-r--r--src/saveload/saveload.cpp3
2 files changed, 34 insertions, 1 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index 33c49fb61..cca9ad328 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -1214,6 +1214,38 @@ bool AfterLoadGame()
}
}
+ /* Railtype moved from m3 to m8 in version 200. */
+ if (IsSavegameVersionBefore(200)) {
+ for (TileIndex t = 0; t < map_size; t++) {
+ switch (GetTileType(t)) {
+ case MP_RAILWAY:
+ SetRailType(t, (RailType)GB(_m[t].m3, 0, 4));
+ break;
+
+ case MP_ROAD:
+ if (IsLevelCrossing(t)) {
+ SetRailType(t, (RailType)GB(_m[t].m3, 0, 4));
+ }
+ break;
+
+ case MP_STATION:
+ if (HasStationRail(t)) {
+ SetRailType(t, (RailType)GB(_m[t].m3, 0, 4));
+ }
+ break;
+
+ case MP_TUNNELBRIDGE:
+ if (GetTunnelBridgeTransportType(t) == TRANSPORT_RAIL) {
+ SetRailType(t, (RailType)GB(_m[t].m3, 0, 4));
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+
/* Elrails got added in rev 24 */
if (IsSavegameVersionBefore(24)) {
RailType min_rail = RAILTYPE_ELECTRIC;
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index 692f73cf2..d02dfcbc6 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -267,8 +267,9 @@
* 197 27978 1.8.x
* 198
* 199
+ * 200
*/
-extern const uint16 SAVEGAME_VERSION = 199; ///< Current savegame version of OpenTTD.
+extern const uint16 SAVEGAME_VERSION = 200; ///< Current savegame version of OpenTTD.
SavegameType _savegame_type; ///< type of savegame we are loading
FileToSaveLoad _file_to_saveload; ///< File to save or load in the openttd loop.