1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-29 00:41:38 +02:00

- compile fixes

- fixed portrait initialization for random heroes
This commit is contained in:
Ivan Savenko
2013-02-12 21:32:55 +00:00
parent bda766b697
commit 7e46d462b6
4 changed files with 8 additions and 5 deletions

View File

@ -683,8 +683,9 @@ void CGameState::randomizeObject(CGObjectInstance *cur)
CGHeroInstance *h = dynamic_cast<CGHeroInstance *>(cur);
if(!h) {tlog2<<"Wrong random hero at "<<cur->pos<<std::endl; return;}
cur->ID = ran.first;
h->portrait = cur->subID = ran.second;
cur->subID = ran.second;
h->type = VLC->heroh->heroes[ran.second];
h->portrait = h->type->imageIndex;
h->randomizeArmy(h->type->heroClass->faction);
map->heroes.push_back(h);
return; //TODO: maybe we should do something with definfo?