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

@ -351,15 +351,6 @@ void CGameState::initCampaign()
map = campaign->getCurrentMap();
}
void CGameState::generateOwnedObjectsAfterDeserialize()
{
for (auto & object : map->objects)
{
if (object && object->asOwnable() && object->getOwner().isValidPlayer())
players.at(object->getOwner()).addOwnedObject(object.get());
}
}
void CGameState::initGlobalBonuses()
{
const JsonNode & baseBonuses = getSettings().getValue(EGameSettings::BONUSES_GLOBAL);

View File

@ -171,21 +171,13 @@ public:
h & day;
h & map;
h & players;
if (h.version < Handler::Version::PLAYER_STATE_OWNED_OBJECTS)
generateOwnedObjectsAfterDeserialize();
h & teams;
h & heroesPool;
h & globalEffects;
if (h.version < Handler::Version::REMOVE_LIB_RNG)
{
std::string oldStateOfRNG;
h & oldStateOfRNG;
}
h & currentRumor;
h & campaign;
h & allocatedArtifacts;
if (h.version >= Handler::Version::STATISTICS)
h & statistic;
h & statistic;
BONUS_TREE_DESERIALIZATION_FIX
}
@ -213,8 +205,6 @@ private:
void initVisitingAndGarrisonedHeroes();
void initCampaign();
void generateOwnedObjectsAfterDeserialize();
// ----- bonus system handling -----
void buildBonusSystemTree();

View File

@ -63,8 +63,7 @@ struct DLL_LINKAGE StatisticDataSetEntry
h & timestamp;
h & day;
h & player;
if(h.version >= Handler::Version::STATISTICS_SCREEN)
h & playerName;
h & playerName;
h & team;
h & isHuman;
h & status;
@ -92,11 +91,8 @@ struct DLL_LINKAGE StatisticDataSetEntry
h & spentResourcesForArmy;
h & spentResourcesForBuildings;
h & tradeVolume;
if(h.version >= Handler::Version::STATISTICS_SCREEN)
{
h & eventCapturedTown;
h & eventDefeatedStrongestHero;
}
h & eventCapturedTown;
h & eventDefeatedStrongestHero;
h & movementPointsUsed;
}
};
@ -136,11 +132,8 @@ public:
h & spentResourcesForBuildings;
h & tradeVolume;
h & movementPointsUsed;
if(h.version >= Handler::Version::STATISTICS_SCREEN)
{
h & lastCapturedTownDay;
h & lastDefeatedStrongestHeroDay;
}
h & lastCapturedTownDay;
h & lastDefeatedStrongestHeroDay;
}
};
std::vector<StatisticDataSetEntry> data;