浏览代码

Merge pull request #66585 from timothyqiu/navobs-radius

Rémi Verschelde 2 年之前
父节点
当前提交
0d388255e6
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      scene/3d/navigation_obstacle.cpp

+ 3 - 4
scene/3d/navigation_obstacle.cpp

@@ -216,12 +216,11 @@ real_t NavigationObstacle::estimate_agent_radius() const {
 		}
 		Vector3 s = parent_spatial->get_global_transform().basis.get_scale();
 		radius *= MAX(s.x, MAX(s.y, s.z));
-	}
 
-	if (radius > 0.0) {
-		return radius;
+		if (radius > 0.0) {
+			return radius;
+		}
 	}
-
 	return 1.0; // Never a 0 radius
 }