summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-05-20 23:47:24 +0200
committerErich Eckner <git@eckner.net>2022-01-16 21:58:17 +0100
commit159931deeae922fbbf05774b8dbbe0585a404d41 (patch)
treeda7163671735812a3c217e8ad60223172c393de0
parent0e56a5e3bf23b73b0238520e6ed2652cfb3988b0 (diff)
downloadopenttd-159931deeae922fbbf05774b8dbbe0585a404d41.tar.xz
increase SaveLoadVersion beyond SLV_UNDERGROUND
-rw-r--r--src/saveload/map_sl.cpp4
-rw-r--r--src/saveload/saveload.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/src/saveload/map_sl.cpp b/src/saveload/map_sl.cpp
index e85313762..29ef2f083 100644
--- a/src/saveload/map_sl.cpp
+++ b/src/saveload/map_sl.cpp
@@ -27,7 +27,7 @@ static uint32 _layer_count;
static const SaveLoad _map_desc[] = {
SLEG_CONDVAR("dim_x", _map_dim_x, SLE_UINT32, SLV_6, SL_MAX_VERSION),
SLEG_CONDVAR("dim_y", _map_dim_y, SLE_UINT32, SLV_6, SL_MAX_VERSION),
- SLEG_CONDVAR("layer_count", _layer_count, SLE_UINT32, SLV_6, SL_MAX_VERSION),
+ SLEG_CONDVAR("layer_count", _layer_count, SLE_UINT32, SLV_UNDERGROUND, SL_MAX_VERSION),
};
struct MAPSChunkHandler : ChunkHandler {
@@ -53,6 +53,8 @@ struct MAPSChunkHandler : ChunkHandler {
SlGlobList(slt);
if (!IsSavegameVersionBefore(SLV_RIFF_TO_ARRAY) && SlIterateArray() != -1) SlErrorCorrupt("Too many MAPS entries");
+ if (IsSavegameVersionBefore(SLV_UNDERGROUND))
+ _layer_count = 1;
AllocateMap(_map_dim_x, _map_dim_y/_layer_count, _layer_count);
}
diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h
index 0d4e0fb98..a8ef3fbe3 100644
--- a/src/saveload/saveload.h
+++ b/src/saveload/saveload.h
@@ -307,6 +307,7 @@ enum SaveLoadVersion : uint16 {
SLV_MULTITILE_DOCKS, ///< 216 PR#7380 Multiple docks per station.
SLV_TRADING_AGE, ///< 217 PR#7780 Configurable company trading age.
SLV_ENDING_YEAR, ///< 218 PR#7747 v1.10 Configurable ending year.
+ SLV_UNDERGROUND, ///< 219 Underground levels.
SLV_REMOVE_TOWN_CARGO_CACHE, ///< 219 PR#8258 Remove town cargo acceptance and production caches.
/* Patchpacks for a while considered it a good idea to jump a few versions