mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
serialize uidCounter in CMap
This commit is contained in:
@@ -348,8 +348,15 @@ public:
|
|||||||
|
|
||||||
h & instanceNames;
|
h & instanceNames;
|
||||||
h & *gameSettings;
|
h & *gameSettings;
|
||||||
if (!h.saving)
|
if (!h.hasFeature(Handler::Version::STORE_UID_COUNTER_IN_CMAP)
|
||||||
parseUidCounter();
|
{
|
||||||
|
if (!h.saving)
|
||||||
|
parseUidCounter();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
h & uidCounter;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,9 @@ enum class ESerializationVersion : int32_t
|
|||||||
|
|
||||||
MAP_HEADER_DISPOSED_HEROES, // map header contains disposed heroes list
|
MAP_HEADER_DISPOSED_HEROES, // map header contains disposed heroes list
|
||||||
NO_RAW_POINTERS_IN_SERIALIZER, // large rework that removed all non-owning pointers from serializer
|
NO_RAW_POINTERS_IN_SERIALIZER, // large rework that removed all non-owning pointers from serializer
|
||||||
|
STORE_UID_COUNTER_IN_CMAP, // fix crash caused by conflicting instanceName after loading game
|
||||||
|
|
||||||
CURRENT = NO_RAW_POINTERS_IN_SERIALIZER,
|
CURRENT = STORE_UID_COUNTER_IN_CMAP,
|
||||||
};
|
};
|
||||||
|
|
||||||
static_assert(ESerializationVersion::MINIMAL <= ESerializationVersion::CURRENT, "Invalid serialization version definition!");
|
static_assert(ESerializationVersion::MINIMAL <= ESerializationVersion::CURRENT, "Invalid serialization version definition!");
|
||||||
|
|||||||
Reference in New Issue
Block a user