1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-05 00:49:09 +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

@ -51,10 +51,7 @@ public:
h & bankConfig;
h & resetDuration;
h & coastVisitable;
if (h.version >= Handler::Version::BANK_UNIT_PLACEMENT)
h & regularUnitPlacement;
else if (!h.saving)
regularUnitPlacement = false;
h & regularUnitPlacement;
}
friend class CBankInstanceConstructor;

View File

@ -371,14 +371,6 @@ public:
h & skillsInfo;
h & visitedTown;
h & boat;
if (h.version < Handler::Version::REMOVE_TOWN_PTR)
{
HeroTypeID type;
bool isNull = false;
h & isNull;
if(!isNull)
h & type;
}
h & commander;
h & visitedObjects;
BONUS_TREE_DESERIALIZATION_FIX

View File

@ -36,37 +36,6 @@ public:
int getMarketEfficiency() const override;
int availableUnits(EMarketMode mode, int marketItemSerial) const override; //-1 if unlimited
std::set<EMarketMode> availableModes() const override;
template <typename Handler>
void serialize(Handler &h)
{
h & static_cast<CGObjectInstance&>(*this);
if (h.version < Handler::Version::NEW_MARKETS)
{
std::set<EMarketMode> marketModes;
h & marketModes;
}
if (h.version < Handler::Version::MARKET_TRANSLATION_FIX)
{
int unused = 0;
h & unused;
}
if (h.version < Handler::Version::NEW_MARKETS)
{
std::string speech;
std::string title;
h & speech;
h & title;
}
}
template <typename Handler> void serializeArtifactsAltar(Handler &h)
{
serialize(h);
IMarket::serializeArtifactsAltar(h);
}
};
class DLL_LINKAGE CGBlackMarket : public CGMarket
@ -82,24 +51,7 @@ public:
template <typename Handler> void serialize(Handler &h)
{
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;
}
};
@ -119,12 +71,6 @@ public:
{
h & static_cast<CGMarket&>(*this);
h & skills;
if (h.version >= Handler::Version::NEW_MARKETS && h.version < Handler::Version::MARKET_TRANSLATION_FIX)
{
std::string temp;
h & temp;
h & temp;
}
}
};

View File

@ -143,12 +143,6 @@ public:
template <typename Handler> void serialize(Handler &h)
{
h & instanceName;
if (h.version < Handler::Version::REMOVE_OBJECT_TYPENAME)
{
std::string unused;
h & unused;
h & unused;
}
h & pos;
h & ID;
subID.serializeIdentifier(h, ID);

View File

@ -94,43 +94,13 @@ public:
h & obligatorySpells;
h & spells;
h & events;
if (h.version >= Handler::Version::SPELL_RESEARCH)
{
h & spellResearchCounterDay;
h & spellResearchAcceptedCounter;
h & spellResearchAllowed;
}
if (h.version >= Handler::Version::NEW_TOWN_BUILDINGS)
{
h & rewardableBuildings;
}
else
{
std::vector<TownRewardableBuildingInstance*> oldVector;
h & oldVector;
rewardableBuildings = convertOldBuildings(oldVector);
}
if (h.version < Handler::Version::REMOVE_TOWN_PTR)
{
FactionID faction;
bool isNull = false;
h & isNull;
if (!isNull)
h & faction;
}
h & spellResearchCounterDay;
h & spellResearchAcceptedCounter;
h & spellResearchAllowed;
h & rewardableBuildings;
h & townAndVis;
BONUS_TREE_DESERIALIZATION_FIX
if (h.version < Handler::Version::NEW_TOWN_BUILDINGS)
{
std::set<BuildingID> overriddenBuildings;
h & overriddenBuildings;
}
if(!h.saving)
postDeserialize();
}

View File

@ -36,11 +36,6 @@ public:
CArtifactSet * getArtifactsStorage() const;
bool getOffer(int id1, int id2, int &val1, int &val2, EMarketMode mode) const; //val1 - how many units of id1 player has to give to receive val2 units
template <typename Handler> void serializeArtifactsAltar(Handler &h)
{
h & *altarArtifactsStorage;
}
private:
std::unique_ptr<CArtifactSetAltar> altarArtifactsStorage;
};

View File

@ -43,14 +43,6 @@ public:
template <typename Handler> void serialize(Handler &h)
{
h & bID;
if (h.version < Handler::Version::NEW_TOWN_BUILDINGS)
{
// compatibility code
si32 indexOnTV = 0; //identifies its index on towns vector
BuildingSubID::EBuildingSubID bType = BuildingSubID::NONE;
h & indexOnTV;
h & bType;
}
}
private:
@ -90,8 +82,7 @@ public:
template <typename Handler> void serialize(Handler &h)
{
h & static_cast<TownBuildingInstance&>(*this);
if (h.version >= Handler::Version::NEW_TOWN_BUILDINGS)
h & static_cast<Rewardable::Interface&>(*this);
h & static_cast<Rewardable::Interface&>(*this);
h & visitors;
}
};