mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
CPathfinder: deny transit over whirlpools when hero not protected
This commit is contained in:
@@ -315,7 +315,13 @@ bool CPathfinder::isMovementAfterDestPossible()
|
|||||||
if(dp->coord == out.hpos)
|
if(dp->coord == out.hpos)
|
||||||
return true; // This one is tricky, we can ignore fact that tile is not ACCESSIBLE in case if it's our hero block it. Though this need investigation
|
return true; // This one is tricky, we can ignore fact that tile is not ACCESSIBLE in case if it's our hero block it. Though this need investigation
|
||||||
if(dp->accessible == CGPathNode::VISITABLE && CGTeleport::isTeleport(dt->topVisitableObj()))
|
if(dp->accessible == CGPathNode::VISITABLE && CGTeleport::isTeleport(dt->topVisitableObj()))
|
||||||
return true; // For now we'll always allow transit for teleporters
|
{
|
||||||
|
/// For now we'll always allow transit over teleporters
|
||||||
|
/// Transit over whirlpools only allowed when hero protected
|
||||||
|
auto whirlpool = dynamic_cast<const CGWhirlpool *>(dt->topVisitableObj());
|
||||||
|
if(!whirlpool || options.useTeleportWhirlpool)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if(useEmbarkCost && options.useEmbarkAndDisembark)
|
if(useEmbarkCost && options.useEmbarkAndDisembark)
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user