mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-17 11:56:46 +02:00
Remove final path node when directly attacking guards
This commit is contained in:
parent
e9aed2761c
commit
56e1866db9
@ -2418,6 +2418,9 @@ bool CGameHandler::moveHero(ObjectInstanceID hid, int3 dst, ui8 teleporting, boo
|
|||||||
if (leavingTile == LEAVING_TILE)
|
if (leavingTile == LEAVING_TILE)
|
||||||
leaveTile();
|
leaveTile();
|
||||||
|
|
||||||
|
if (isInTheMap(guardPos))
|
||||||
|
tmh.attackedFrom = boost::make_optional(guardPos);
|
||||||
|
|
||||||
tmh.result = result;
|
tmh.result = result;
|
||||||
sendAndApply(&tmh);
|
sendAndApply(&tmh);
|
||||||
|
|
||||||
@ -2425,10 +2428,8 @@ bool CGameHandler::moveHero(ObjectInstanceID hid, int3 dst, ui8 teleporting, boo
|
|||||||
{ // Hero should be always able to visit any object he staying on even if there guards around
|
{ // Hero should be always able to visit any object he staying on even if there guards around
|
||||||
visitObjectOnTile(t, h);
|
visitObjectOnTile(t, h);
|
||||||
}
|
}
|
||||||
else if (lookForGuards == CHECK_FOR_GUARDS && this->isInTheMap(guardPos))
|
else if (lookForGuards == CHECK_FOR_GUARDS && isInTheMap(guardPos))
|
||||||
{
|
{
|
||||||
tmh.attackedFrom = boost::make_optional(guardPos);
|
|
||||||
|
|
||||||
const TerrainTile &guardTile = *gs->getTile(guardPos);
|
const TerrainTile &guardTile = *gs->getTile(guardPos);
|
||||||
objectVisited(guardTile.visitableObjects.back(), h);
|
objectVisited(guardTile.visitableObjects.back(), h);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user