diff --git a/docs/landscape.html b/docs/landscape.html
index 231bfe6bec..40d73c7fe4 100644
--- a/docs/landscape.html
+++ b/docs/landscape.html
@@ -520,7 +520,7 @@
m2 bit 11: opposite track is reserved, too
- m5 bit 7 set, bit 6 set: railway depot
+ m5 bit 7 set, bit 6 clear: railway depot
- m2: Depot index
- m5 bits 1..0: exit towards
diff --git a/docs/landscape_grid.html b/docs/landscape_grid.html
index 5121d5224f..6e59a3acac 100644
--- a/docs/landscape_grid.html
+++ b/docs/landscape_grid.html
@@ -118,7 +118,7 @@ the array so you can quickly see what is used and what is not.
XXXX XXXX XXXX XXXX |
OOOO OOOO |
OOOO XXXX |
- 11OX OOXX |
+ 1OOX OOXX |
2 |
diff --git a/src/rail_map.h b/src/rail_map.h
index 5ff2fb9ec3..03bca7e6e3 100644
--- a/src/rail_map.h
+++ b/src/rail_map.h
@@ -23,7 +23,7 @@
enum RailTileType {
RAIL_TILE_NORMAL = 0, ///< Normal rail tile without signals
RAIL_TILE_SIGNALS = 1, ///< Normal rail tile with signals
- RAIL_TILE_DEPOT = 3, ///< Depot (one entrance)
+ RAIL_TILE_DEPOT = 2, ///< Depot
};
/**
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index 7f35427e0a..3719cbd398 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -641,6 +641,15 @@ bool AfterLoadGame()
}
}
+ if (IsSavegameVersionBefore(SLV_DEPOTS_ALIGN_RAIL_DEPOT_BITS)) {
+ for (auto t : Map::Iterate()) {
+ if (IsTileType(t, MP_RAILWAY) && GetRailTileType(t) == 3) {
+ /* Change the rail type for depots from old value 3 to new value 2. */
+ SB(t.m5(), 6, 2, RAIL_TILE_DEPOT);
+ }
+ }
+ }
+
/* in version 2.1 of the savegame, town owner was unified. */
if (IsSavegameVersionBefore(SLV_2, 1)) ConvertTownOwner();
diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h
index 1c73661357..dd4d9af27f 100644
--- a/src/saveload/saveload.h
+++ b/src/saveload/saveload.h
@@ -390,6 +390,7 @@ enum SaveLoadVersion : uint16_t {
SLV_DEPOTID_BACKUP_ORDERS, ///< 314 PR#XXXXX Backup orders are indexed through DepotIDs.
SLV_ALIGN_WATER_BITS, ///< 315 PR#XXXXX Align some water bits in the map array.
+ SLV_DEPOTS_ALIGN_RAIL_DEPOT_BITS, ///< 316 PR#XXXXX Align one bit for rail depots.
SL_MAX_VERSION, ///< Highest possible saveload version
};