1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

NavMap2D: check if obstacles have avoidance enabled

In NavMap2D::_update_rvo_obstacles_tree() check if the NavObstacle2D
has avoidance enabled before adding it to the tree.

This is the 2D fix for #108259
This commit is contained in:
David M. Lary
2025-07-04 10:30:49 -05:00
parent 9b22b41531
commit 780f3d5e3b

View File

@@ -444,6 +444,9 @@ void NavMap2D::_update_rvo_obstacles_tree() {
// The following block is modified copy from RVO2D::AddObstacle()
// Obstacles are linked and depend on all other obstacles.
for (NavObstacle2D *obstacle : obstacles) {
if (!obstacle->is_avoidance_enabled()) {
continue;
}
const Vector2 &_obstacle_position = obstacle->get_position();
const Vector<Vector2> &_obstacle_vertices = obstacle->get_vertices();