1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Fix game startup

This commit is contained in:
Ivan Savenko
2023-10-26 16:50:29 +03:00
parent cc30bdda04
commit 461c481ef3
6 changed files with 20 additions and 14 deletions

View File

@@ -569,15 +569,17 @@ void CGHeroInstance::pickRandomObject(CRandomGenerator & rand)
{
ID = Obj::HERO;
subID = cb->gameState()->pickNextHeroType(getOwner());
type = VLC->heroh->objects[subID];
randomizeArmy(type->heroClass->faction);
}
type = VLC->heroh->objects[subID];
// to find object handler we must use heroClass->id
// after setType subID used to store unique hero identify id. Check issue 2277 for details
setType(ID, type->heroClass->getIndex());
if (ID != Obj::PRISON)
{
// to find object handler we must use heroClass->id
// after setType subID used to store unique hero identify id. Check issue 2277 for details
setType(ID, type->heroClass->getIndex());
}
this->subID = subID;
randomizeArmy(type->heroClass->faction);
}
void CGHeroInstance::initObj(CRandomGenerator & rand)