1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

Fix hero serialization

This commit is contained in:
nordsoft 2022-12-04 16:58:03 +04:00
parent 9d054f0bd5
commit bd32bd66b3

View File

@ -128,10 +128,15 @@ void MapController::repairMap()
assert(type->heroClass); assert(type->heroClass);
//TODO: find a way to get proper type name //TODO: find a way to get proper type name
if(obj->ID == Obj::HERO) if(obj->ID == Obj::HERO)
{
nih->typeName = "hero"; nih->typeName = "hero";
if(obj->ID == Obj::PRISON)
nih->typeName = "prison";
nih->subTypeName = type->heroClass->identifier; nih->subTypeName = type->heroClass->identifier;
}
if(obj->ID == Obj::PRISON)
{
nih->typeName = "prison";
nih->subTypeName = "prison";
}
nih->type = type; nih->type = type;
if(nih->name.empty()) if(nih->name.empty())