From 41d788375a7dd35e934de382d3d047e10bf7d5d8 Mon Sep 17 00:00:00 2001 From: Pawel Lampe Date: Fri, 22 Apr 2022 18:19:11 +0200 Subject: [PATCH] Fix crash in `GodotNavigationServer::map_get_path`, fixes #60413 --- modules/navigation/nav_map.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp index 2b2bd54ee98..574b45c271f 100644 --- a/modules/navigation/nav_map.cpp +++ b/modules/navigation/nav_map.cpp @@ -156,10 +156,10 @@ Vector NavMap::get_path(Vector3 p_origin, Vector3 p_destination, bool p while (found_route == false) { { - gd::NavigationPoly *least_cost_poly = &navigation_polys[least_cost_id]; - // Takes the current least_cost_poly neighbors and compute the traveled_distance of each for (size_t i = 0; i < navigation_polys[least_cost_id].poly->edges.size(); i++) { + gd::NavigationPoly *least_cost_poly = &navigation_polys[least_cost_id]; + const gd::Edge &edge = least_cost_poly->poly->edges[i]; if (!edge.other_polygon) continue;