1
0
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:
Vadim Markovtsev
2016-01-26 22:24:38 +03:00
parent 6a7b1a1737
commit 7772b6de74
4 changed files with 70 additions and 47 deletions

View File

@@ -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)