mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
multilevel support
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user