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

Boat will be removed when hero is defeated on water.

Should fix #1303, #1419, #1425.
This commit is contained in:
Michał W. Urbańczyk
2013-09-08 21:50:49 +00:00
parent 6331995afd
commit ab042aa685

View File

@ -334,6 +334,12 @@ DLL_LINKAGE void RemoveObject::applyGs( CGameState *gs )
gs->map->objects[id.getNum()] = nullptr;
//If hero on Boat is removed, the Boat disappears
if(h->boat)
{
gs->map->objects[h->boat->id.getNum()].dellNull();
h->boat = nullptr;
}
return;
}
@ -500,6 +506,9 @@ DLL_LINKAGE void HeroRecruited::applyGs( CGameState *gs )
CGHeroInstance *h = gs->hpool.heroesPool[hid];
CGTownInstance *t = gs->getTown(tid);
PlayerState *p = gs->getPlayer(player);
assert(!h->boat);
h->setOwner(player);
h->pos = tile;
h->movement = h->maxMovePoints(true);