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:
@ -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);
|
||||
|
Reference in New Issue
Block a user