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

attempt to fix hero placeholder while reading h3m

This commit is contained in:
godric3
2024-08-22 17:09:23 +02:00
parent 786be6f253
commit cda66c4196
2 changed files with 2 additions and 2 deletions

View File

@@ -343,7 +343,7 @@ TObjectTypeHandler CObjectClassesHandler::getHandlerFor(MapObjectID type, MapObj
return objects.front()->objects.front(); return objects.front()->objects.front();
auto subID = subtype.getNum(); auto subID = subtype.getNum();
if (type == Obj::PRISON) if (type == Obj::PRISON || type == Obj::HERO_PLACEHOLDER)
subID = 0; subID = 0;
auto result = objects.at(type.getNum())->objects.at(subID); auto result = objects.at(type.getNum())->objects.at(subID);

View File

@@ -475,7 +475,7 @@ void Inspector::updateProperties()
addProperty("TypeName", obj->typeName); addProperty("TypeName", obj->typeName);
addProperty("SubTypeName", obj->subTypeName); addProperty("SubTypeName", obj->subTypeName);
if(!dynamic_cast<CGHeroInstance*>(obj)) if(!dynamic_cast<CGHeroInstance*>(obj) && obj->ID != Obj::HERO_PLACEHOLDER)
{ {
auto factory = VLC->objtypeh->getHandlerFor(obj->ID, obj->subID); auto factory = VLC->objtypeh->getHandlerFor(obj->ID, obj->subID);
addProperty("IsStatic", factory->isStaticObject()); addProperty("IsStatic", factory->isStaticObject());