Skip to content

Commit

Permalink
Fix missing NavigationObstacle property updates in constructor
Browse files Browse the repository at this point in the history
Fixes missing NavigationObstacle property updates in constructor.
  • Loading branch information
smix8 committed Oct 23, 2023
1 parent f71f4b8 commit 618d949
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
8 changes: 4 additions & 4 deletions scene/2d/navigation_obstacle_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ void NavigationObstacle2D::_notification(int p_what) {
NavigationObstacle2D::NavigationObstacle2D() {
obstacle = NavigationServer2D::get_singleton()->obstacle_create();

set_radius(radius);
set_vertices(vertices);
set_avoidance_layers(avoidance_layers);
set_avoidance_enabled(avoidance_enabled);
NavigationServer2D::get_singleton()->obstacle_set_radius(obstacle, radius);
NavigationServer2D::get_singleton()->obstacle_set_vertices(obstacle, vertices);
NavigationServer2D::get_singleton()->obstacle_set_avoidance_layers(obstacle, avoidance_layers);
NavigationServer2D::get_singleton()->obstacle_set_avoidance_enabled(obstacle, avoidance_enabled);
}

NavigationObstacle2D::~NavigationObstacle2D() {
Expand Down
12 changes: 5 additions & 7 deletions scene/3d/navigation_obstacle_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,11 @@ NavigationObstacle3D::NavigationObstacle3D() {
obstacle = NavigationServer3D::get_singleton()->obstacle_create();

NavigationServer3D::get_singleton()->obstacle_set_height(obstacle, height);

set_radius(radius);
set_height(height);
set_vertices(vertices);
set_avoidance_layers(avoidance_layers);
set_avoidance_enabled(avoidance_enabled);
set_use_3d_avoidance(use_3d_avoidance);
NavigationServer3D::get_singleton()->obstacle_set_radius(obstacle, radius);
NavigationServer3D::get_singleton()->obstacle_set_vertices(obstacle, vertices);
NavigationServer3D::get_singleton()->obstacle_set_avoidance_layers(obstacle, avoidance_layers);
NavigationServer3D::get_singleton()->obstacle_set_use_3d_avoidance(obstacle, use_3d_avoidance);
NavigationServer3D::get_singleton()->obstacle_set_avoidance_enabled(obstacle, avoidance_enabled);

#ifdef DEBUG_ENABLED
NavigationServer3D::get_singleton()->connect("avoidance_debug_changed", callable_mp(this, &NavigationObstacle3D::_update_fake_agent_radius_debug));
Expand Down

0 comments on commit 618d949

Please sign in to comment.