mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Restore save compatibility with 1.5
This commit is contained in:
parent
b9ff192a91
commit
c3c5f73a63
@ -108,6 +108,15 @@ public:
|
|||||||
template <typename Handler> void serialize(Handler &h)
|
template <typename Handler> void serialize(Handler &h)
|
||||||
{
|
{
|
||||||
h & static_cast<ILimiter&>(*this);
|
h & static_cast<ILimiter&>(*this);
|
||||||
|
|
||||||
|
if (h.version < Handler::Version::REMOVE_TOWN_PTR)
|
||||||
|
{
|
||||||
|
bool isNull = false;
|
||||||
|
h & isNull;
|
||||||
|
if(!isNull)
|
||||||
|
h & creatureID;
|
||||||
|
}
|
||||||
|
else
|
||||||
h & creatureID;
|
h & creatureID;
|
||||||
h & includeUpgrades;
|
h & includeUpgrades;
|
||||||
}
|
}
|
||||||
|
@ -78,8 +78,25 @@ public:
|
|||||||
template <typename Handler> void serialize(Handler &h)
|
template <typename Handler> void serialize(Handler &h)
|
||||||
{
|
{
|
||||||
h & static_cast<CGMarket&>(*this);
|
h & static_cast<CGMarket&>(*this);
|
||||||
|
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;
|
||||||
|
artifacts.push_back(artifact);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
h & artifacts;
|
h & artifacts;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE CGUniversity : public CGMarket
|
class DLL_LINKAGE CGUniversity : public CGMarket
|
||||||
|
@ -222,7 +222,25 @@ public:
|
|||||||
// static members
|
// static members
|
||||||
h & obeliskCount;
|
h & obeliskCount;
|
||||||
h & obelisksVisited;
|
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 & townUniversitySkills;
|
||||||
|
|
||||||
h & instanceNames;
|
h & instanceNames;
|
||||||
|
@ -146,10 +146,9 @@ struct DLL_LINKAGE TerrainTile
|
|||||||
{
|
{
|
||||||
bool isNull = false;
|
bool isNull = false;
|
||||||
h & isNull;
|
h & isNull;
|
||||||
if (isNull)
|
if (!isNull)
|
||||||
h & terrainType;
|
h & terrainType;
|
||||||
}
|
}
|
||||||
h & terrainType;
|
|
||||||
h & terView;
|
h & terView;
|
||||||
if (h.version >= Handler::Version::REMOVE_VLC_POINTERS)
|
if (h.version >= Handler::Version::REMOVE_VLC_POINTERS)
|
||||||
{
|
{
|
||||||
@ -159,7 +158,7 @@ struct DLL_LINKAGE TerrainTile
|
|||||||
{
|
{
|
||||||
bool isNull = false;
|
bool isNull = false;
|
||||||
h & isNull;
|
h & isNull;
|
||||||
if (isNull)
|
if (!isNull)
|
||||||
h & riverType;
|
h & riverType;
|
||||||
}
|
}
|
||||||
h & riverDir;
|
h & riverDir;
|
||||||
@ -171,7 +170,7 @@ struct DLL_LINKAGE TerrainTile
|
|||||||
{
|
{
|
||||||
bool isNull = false;
|
bool isNull = false;
|
||||||
h & isNull;
|
h & isNull;
|
||||||
if (isNull)
|
if (!isNull)
|
||||||
h & roadType;
|
h & roadType;
|
||||||
}
|
}
|
||||||
h & roadDir;
|
h & roadDir;
|
||||||
|
Loading…
Reference in New Issue
Block a user