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:
parent
0b9f601d2c
commit
0563828763
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user