1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

multilevel support

This commit is contained in:
Laserlicht
2025-08-01 00:37:32 +02:00
parent 50a240a858
commit ecfe09f6b1
27 changed files with 156 additions and 107 deletions

View File

@@ -246,7 +246,7 @@ public:
si32 height; /// The default value is 72.
si32 width; /// The default value is 72.
bool twoLevel; /// The default value is true.
si32 mapLevels; /// The default value is 2.
MetaString name;
MetaString description;
EMapDifficulty difficulty;
@@ -295,7 +295,23 @@ public:
h & creationDateTime;
h & width;
h & height;
h & twoLevel;
if (h.version >= Handler::Version::MORE_MAP_LAYERS)
h & mapLevels;
else
{
if (h.saving)
{
bool hasTwoLevels = mapLevels == 2;
h & hasTwoLevels;
}
else
{
bool hasTwoLevels;
h & hasTwoLevels;
mapLevels = hasTwoLevels ? 2 : 1;
}
}
h & difficulty;
h & levelLimit;