mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Fix 981 reset hero on hiring after retreat/surrender
This commit is contained in:
@@ -594,7 +594,11 @@ DLL_LINKAGE void HeroRecruited::applyGs( CGameState *gs )
|
||||
|
||||
h->setOwner(player);
|
||||
h->pos = tile;
|
||||
h->movement = h->maxMovePoints(true);
|
||||
bool fresh = !h->isInitialized();
|
||||
if(fresh)
|
||||
{ // this is a fresh hero who hasn't appeared yet
|
||||
h->movement = h->maxMovePoints(true);
|
||||
}
|
||||
|
||||
gs->hpool.heroesPool.erase(hid);
|
||||
if(h->id == ObjectInstanceID())
|
||||
@@ -608,7 +612,10 @@ DLL_LINKAGE void HeroRecruited::applyGs( CGameState *gs )
|
||||
gs->map->heroesOnMap.push_back(h);
|
||||
p->heroes.push_back(h);
|
||||
h->attachTo(p);
|
||||
h->initObj();
|
||||
if(fresh)
|
||||
{
|
||||
h->initObj();
|
||||
}
|
||||
gs->map->addBlockVisTiles(h);
|
||||
|
||||
if(t)
|
||||
|
||||
Reference in New Issue
Block a user