1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Remove save compatibility with 1.5.X

This commit is contained in:
Ivan Savenko
2025-03-18 11:35:15 +00:00
parent 81759143f4
commit eb3b51a6cf
27 changed files with 86 additions and 542 deletions

View File

@@ -192,31 +192,11 @@ public:
// static members
h & obeliskCount;
h & obelisksVisited;
if (h.version < Handler::Version::REMOVE_VLC_POINTERS)
{
int32_t size = 0;
h & size;
for (int32_t i = 0; i < size; ++i)
{
bool isNull = false;
ArtifactID artifact;
h & isNull;
if (!isNull)
h & artifact;
townMerchantArtifacts.push_back(artifact);
}
}
else
{
h & townMerchantArtifacts;
}
h & townMerchantArtifacts;
h & townUniversitySkills;
h & instanceNames;
if (h.version >= Handler::Version::PER_MAP_GAME_SETTINGS)
h & *gameSettings;
h & *gameSettings;
}
};

View File

@@ -52,26 +52,12 @@ public:
h & name;
h & message;
h & resources;
if (h.version >= Handler::Version::EVENTS_PLAYER_SET)
{
h & players;
}
else
{
ui8 playersMask = 0;
h & playersMask;
for (int i = 0; i < 8; ++i)
if ((playersMask & (1 << i)) != 0)
players.insert(PlayerColor(i));
}
h & players;
h & humanAffected;
h & computerAffected;
h & firstOccurrence;
h & nextOccurrence;
if(h.version >= Handler::Version::EVENT_OBJECTS_DELETION)
{
h & deletedObjectsInstances;
}
h & deletedObjectsInstances;
}
virtual void serializeJson(JsonSerializeFormat & handler);
@@ -147,49 +133,13 @@ struct DLL_LINKAGE TerrainTile
template <typename Handler>
void serialize(Handler & h)
{
if (h.version >= Handler::Version::REMOVE_VLC_POINTERS)
{
h & terrainType;
}
else
{
bool isNull = false;
h & isNull;
if (!isNull)
h & terrainType;
}
h & terrainType;
h & terView;
if (h.version >= Handler::Version::REMOVE_VLC_POINTERS)
{
h & riverType;
}
else
{
bool isNull = false;
h & isNull;
if (!isNull)
h & riverType;
}
h & riverType;
h & riverDir;
if (h.version >= Handler::Version::REMOVE_VLC_POINTERS)
{
h & roadType;
}
else
{
bool isNull = false;
h & isNull;
if (!isNull)
h & roadType;
}
h & roadType;
h & roadDir;
h & extTileFlags;
if (h.version < Handler::Version::REMOVE_VLC_POINTERS)
{
bool unused = false;
h & unused;
h & unused;
}
h & visitableObjects;
h & blockingObjects;
}

View File

@@ -287,25 +287,14 @@ public:
h & mods;
h & name;
h & description;
if (h.version >= Handler::Version::MAP_FORMAT_ADDITIONAL_INFOS)
{
h & author;
h & authorContact;
h & mapVersion;
h & creationDateTime;
}
h & author;
h & authorContact;
h & mapVersion;
h & creationDateTime;
h & width;
h & height;
h & twoLevel;
if (h.version >= Handler::Version::SAVE_COMPATIBILITY_FIXES)
h & difficulty;
else
{
uint8_t difficultyInteger = static_cast<uint8_t>(difficulty);
h & difficultyInteger;
difficulty = static_cast<EMapDifficulty>(difficultyInteger);
}
h & difficulty;
h & levelLimit;
h & areAnyPlayers;