1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-25 21:38:59 +02:00

Fix loading saved games (add ESerializationVersion)

This commit is contained in:
Kris-Ja 2024-03-23 22:03:06 +01:00
parent 05bbb45824
commit ff35a27176
2 changed files with 7 additions and 1 deletions

View File

@ -105,6 +105,11 @@ struct DLL_LINKAGE Bonus : public std::enable_shared_from_this<Bonus>
h & updater;
h & propagationUpdater;
h & targetSourceType;
if (h.version < Handler::Version::MANA_LIMIT && type == BonusType::MANA_PER_KNOWLEDGE_PERCENTAGE)
{
if (valType == BonusValueType::ADDITIVE_VALUE || valType == BonusValueType::BASE_NUMBER)
val *= 100;
}
}
template <typename Ptr>

View File

@ -37,6 +37,7 @@ enum class ESerializationVersion : int32_t
DESTROYED_OBJECTS, // 834 +list of objects destroyed by player
CAMPAIGN_MAP_TRANSLATIONS, // 835 +campaigns include translations for its maps
JSON_FLAGS, // 836 json uses new format for flags
MANA_LIMIT, // 837 change MANA_PER_KNOWLEGDE to percentage
CURRENT = JSON_FLAGS
CURRENT = MANA_LIMIT
};