1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

fix old vcmi format map loading crash

This commit is contained in:
kdmcser
2025-05-06 01:53:25 +08:00
parent b8f222e7dd
commit 7cb922dd8a
2 changed files with 4 additions and 3 deletions

View File

@@ -278,9 +278,9 @@ public:
const IGameSettings & getSettings() const;
void saveCompatibilityStoreAllocatedArtifactID();
void parseUidCounter();
private:
void parseUidCounter();
/// a 3-dimensional array of terrain tiles, access is as follows: x, y, level. where level=1 is underground
boost::multi_array<TerrainTile, 3> terrain;

View File

@@ -1086,7 +1086,7 @@ void CMapLoaderJson::MapObjectLoader::configure()
spellID = 0;
artID = ArtifactID::SPELL_SCROLL;
}
else if(art->ID == Obj::ARTIFACT)
else if (art->ID == Obj::ARTIFACT || (art->ID >= Obj::RANDOM_ART && art->ID <= Obj::RANDOM_RELIC_ART))
{
//specific artifact
artID = art->getArtifactType();
@@ -1132,6 +1132,7 @@ void CMapLoaderJson::readObjects()
debugHeroesOnMap.insert(hero->getHeroTypeID());
}
map->parseUidCounter();
}
void CMapLoaderJson::readTranslations()