Skip to content

Commit 5ceeff7

Browse files
committed
Merge pull request #100587 from smix8/path_return
Fix early navigtion path return
2 parents 7695628 + c824216 commit 5ceeff7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/navigation/3d/nav_mesh_queries_3d.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ void NavMeshQueries3D::query_task_polygons_get_path(NavMeshPathQueryTask3D &p_qu
295295

296296
_query_task_build_path_corridor(p_query_task, p_polygons, p_map_up, p_link_polygons_size, begin_poly, begin_point, end_poly, end_point);
297297

298+
if (p_query_task.status == NavMeshPathQueryTask3D::TaskStatus::QUERY_FINISHED || p_query_task.status == NavMeshPathQueryTask3D::TaskStatus::QUERY_FAILED) {
299+
return;
300+
}
301+
298302
// Post-Process path.
299303
switch (p_query_task.path_postprocessing) {
300304
case PathPostProcessing::PATH_POSTPROCESSING_CORRIDORFUNNEL: {
@@ -473,6 +477,7 @@ void NavMeshQueries3D::_query_task_build_path_corridor(NavMeshPathQueryTask3D &p
473477

474478
if (closest_point_on_start_poly) {
475479
_query_task_create_same_polygon_two_point_path(p_query_task, begin_poly, begin_point, end_poly, end_point);
480+
p_query_task.status = NavMeshPathQueryTask3D::TaskStatus::QUERY_FINISHED;
476481
return;
477482
}
478483

@@ -523,6 +528,7 @@ void NavMeshQueries3D::_query_task_build_path_corridor(NavMeshPathQueryTask3D &p
523528
}
524529
}
525530
_query_task_create_same_polygon_two_point_path(p_query_task, begin_poly, begin_point, begin_poly, end_point);
531+
p_query_task.status = NavMeshPathQueryTask3D::TaskStatus::QUERY_FINISHED;
526532
return;
527533
}
528534
}

0 commit comments

Comments
 (0)