浏览代码

Simplify code

Ivan Savenko 1 年之前
父节点
当前提交
0a3cfea017
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      lib/pathfinder/PathfindingRules.cpp

+ 4 - 4
lib/pathfinder/PathfindingRules.cpp

@@ -342,11 +342,11 @@ PathfinderBlockingRule::BlockingReason MovementToDestinationRule::getBlockingRea
 		break;
 
 	case EPathfindingLayer::WATER:
-		if(!pathfinderHelper->canMoveBetween(source.coord, destination.coord)
-			|| destination.node->accessible != EPathAccessibility::ACCESSIBLE)
-		{
+		if(!pathfinderHelper->canMoveBetween(source.coord, destination.coord))
+			return BlockingReason::DESTINATION_BLOCKED;
+
+		if (destination.node->accessible != EPathAccessibility::ACCESSIBLE)
 			return BlockingReason::DESTINATION_BLOCKED;
-		}
 
 		if(destination.guarded)
 			return BlockingReason::DESTINATION_BLOCKED;