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

@ -93,45 +93,7 @@ public:
void serialize(Handler & h)
{
std::lock_guard globalLock(globalTextMutex);
if (h.version >= Handler::Version::SIMPLE_TEXT_CONTAINER_SERIALIZATION)
{
h & stringsLocalizations;
}
else
{
std::string key;
int64_t sz = stringsLocalizations.size();
if (h.version >= Handler::Version::REMOVE_TEXT_CONTAINER_SIZE_T)
{
int64_t size = sz;
h & size;
sz = size;
}
else
{
h & sz;
}
if(h.saving)
{
for(auto & s : stringsLocalizations)
{
key = s.first;
h & key;
h & s.second;
}
}
else
{
for(size_t i = 0; i < sz; ++i)
{
h & key;
h & stringsLocalizations[key];
}
}
}
h & stringsLocalizations;
}
};