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

Fix hero initialization for random map

This commit is contained in:
nordsoft 2022-09-18 03:44:52 +04:00
parent 0b9f601d2c
commit 0563828763

View File

@ -86,6 +86,11 @@ void MapController::repairMap()
if(auto * nih = dynamic_cast<CGHeroInstance*>(obj.get()))
{
auto type = VLC->heroh->objects[nih->subID];
nih->type = type;
if(nih->name.empty())
nih->name = nih->type->name;
if(nih->biography.empty())
nih->biography = nih->type->biography;
if(nih->ID == Obj::HERO)
nih->appearance = VLC->objtypeh->getHandlerFor(Obj::HERO, type->heroClass->getIndex())->getTemplates().front();