From 9b525da531d86fa6bc65c27c1bd68a1227d68f8f Mon Sep 17 00:00:00 2001 From: Sean Date: Sun, 2 Oct 2022 13:18:33 -0600 Subject: Fix crash in navigation 3d when target is not reachable The code that resets variables to retry navigation to the closest possible poly was not resetting 1 variable, which caused it to exceed the vector bounds --- modules/navigation/nav_map.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp index 394c32f20d..83862e1e34 100644 --- a/modules/navigation/nav_map.cpp +++ b/modules/navigation/nav_map.cpp @@ -238,6 +238,7 @@ Vector NavMap::get_path(Vector3 p_origin, Vector3 p_destination, bool p to_visit.clear(); to_visit.push_back(0); least_cost_id = 0; + prev_least_cost_id = -1; reachable_end = nullptr; -- cgit v1.2.3