1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-25 21:38:59 +02:00

CPathfinder: deny transit to land blockvis objs from water layer

When hero is in water walking layer he can only exit to accessible or visitable land tiles, but not objects that have blocking visit and leave hero standing on water.
This is different than default flying behaviour because hero in air layer can only transit into accessible land layer without any blocking or visitable objects on them.
This commit is contained in:
ArseniyShestakov 2015-12-16 20:14:36 +03:00
parent bf9ac7318a
commit 9490a5d66d

@ -373,6 +373,16 @@ bool CPathfinder::isLayerTransitionPossible() const
return false;
}
break;
case ELayer::WATER:
if(dp->accessible != CGPathNode::ACCESSIBLE && dp->accessible != CGPathNode::VISITABLE)
{
/// Hero that walking on water can transit to accessible and visitable tiles
/// Though hero can't interact with blocking visit objects while standing on water
return false;
}
break;
}