1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

CPathfinder: don't allow future movement after guarded tile

There is two exceptions:
 - Hero start movement from guarded tile.
 - Hero that embarking into boat that standing on guarded tile.
In other cases future movement is impossible.
This commit is contained in:
ArseniyShestakov
2015-11-05 10:22:38 +03:00
parent ac12a0735e
commit 3de94a8b99

View File

@@ -318,8 +318,6 @@ bool CPathfinder::isMovementAfterDestPossible()
return true; // For now we'll always allow transit for teleporters return true; // For now we'll always allow transit for teleporters
if(useEmbarkCost && options.useEmbarkAndDisembark) if(useEmbarkCost && options.useEmbarkAndDisembark)
return true; return true;
if(isDestinationGuarded() && !isSourceGuarded())
return true; // Can step into a hostile tile once
break; break;
case EPathfindingLayer::AIR: case EPathfindingLayer::AIR: