From fb3033c8c7567d35fc1c50ce7115188170893c5c Mon Sep 17 00:00:00 2001 From: Per Melin Date: Thu, 6 Jun 2024 23:20:05 +0200 Subject: [PATCH] Fix NavigationServer3D.get_closest_point_to_segment() with use_collision --- modules/navigation/nav_map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp index dfbc92a91948..1779be2cc2ea 100644 --- a/modules/navigation/nav_map.cpp +++ b/modules/navigation/nav_map.cpp @@ -617,7 +617,7 @@ Vector3 NavMap::get_closest_point_to_segment(const Vector3 &p_from, const Vector const Face3 f(p.points[0].pos, p.points[point_id - 1].pos, p.points[point_id].pos); Vector3 inters; if (f.intersects_segment(p_from, p_to, &inters)) { - const real_t d = closest_point_d = p_from.distance_to(inters); + const real_t d = p_from.distance_to(inters); if (use_collision == false) { closest_point = inters; use_collision = true;