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

Minor fixes, no more missing objects & templates

This commit is contained in:
Ivan Savenko
2014-06-04 14:15:58 +03:00
parent 7e057b6df8
commit e9b41cd3c6
4 changed files with 29 additions and 2 deletions

View File

@@ -660,6 +660,9 @@ void CArtHandler::afterLoadFinalization()
// Necessary for objects added via mods that don't have any templates in H3
VLC->objtypeh->getHandlerFor(Obj::ARTIFACT, art->id)->addTemplate(templ);
}
// object does not have any templates - this is not usable object (e.g. pseudo-art like lock)
if (VLC->objtypeh->getHandlerFor(Obj::ARTIFACT, art->id)->getTemplates().empty())
VLC->objtypeh->eraseObject(Obj::ARTIFACT, art->id);
}
}