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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user