Browse Source

Do not allow stopping movement while using water walk over water

Ivan Savenko 2 years ago
parent
commit
2e411eca19
1 changed files with 5 additions and 5 deletions
  1. 5 5
      client/CPlayerInterface.cpp

+ 5 - 5
client/CPlayerInterface.cpp

@@ -2025,13 +2025,13 @@ void CPlayerInterface::doMoveHero(const CGHeroInstance * h, CGPath path)
 
 		auto canStop = [&](CGPathNode * node) -> bool
 		{
-			if (node->layer == EPathfindingLayer::LAND || node->layer == EPathfindingLayer::SAIL)
-				return true;
+			if (node->layer != EPathfindingLayer::LAND && node->layer != EPathfindingLayer::SAIL)
+				return false;
 
-			if (node->accessible == EPathAccessibility::ACCESSIBLE)
-				return true;
+			if (node->accessible != EPathAccessibility::ACCESSIBLE)
+				return false;
 
-			return false;
+			return true;
 		};
 
 		for (i=(int)path.nodes.size()-1; i>0 && (stillMoveHero.data == CONTINUE_MOVE || !canStop(&path.nodes[i])); i--)