Browse Source

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.
ArseniyShestakov 10 years ago
parent
commit
9490a5d66d
1 changed files with 10 additions and 0 deletions
  1. 10 0
      lib/CPathfinder.cpp

+ 10 - 0
lib/CPathfinder.cpp

@@ -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;
 	}