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

@@ -1086,14 +1086,14 @@ 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();
}
art->setArtifactInstance(owner->map->createArtifact(artID, spellID.getNum()));
}
}
if(auto hero = std::dynamic_pointer_cast<CGHeroInstance>(instance))
{
@@ -1132,6 +1132,7 @@ void CMapLoaderJson::readObjects()
debugHeroesOnMap.insert(hero->getHeroTypeID());
}
map->parseUidCounter();
}
void CMapLoaderJson::readTranslations()