1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

shift the polygon heap only if index is in range

This commit is contained in:
Kiro
2025-01-07 13:40:17 +01:00
parent aa65940a85
commit f70acb0308
2 changed files with 4 additions and 3 deletions

View File

@@ -314,7 +314,7 @@ void NavMeshQueries3D::_query_task_build_path_corridor(NavMeshPathQueryTask3D &p
owner->get_travel_cost();
neighbor_poly.entry = new_entry;
if (neighbor_poly.poly != nullptr) {
if (neighbor_poly.traversable_poly_index != traversable_polys.INVALID_INDEX) {
traversable_polys.shift(neighbor_poly.traversable_poly_index);
} else {
neighbor_poly.poly = connection.polygon;