Merge pull request #59848 from rburing/estimate_agent_radius_inside_tree

[3.x] `NavigationObstacle2D`: estimate agent radius only when configured to do so
This commit is contained in:
Rémi Verschelde 2022-04-04 09:25:14 +02:00 committed by GitHub
commit 1183abfb79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -147,7 +147,7 @@ void NavigationObstacle2D::initialize_agent() {
}
void NavigationObstacle2D::reevaluate_agent_radius() {
if (!estimate_agent_radius()) {
if (!estimate_radius) {
Navigation2DServer::get_singleton()->agent_set_radius(agent, radius);
} else if (parent_node2d && parent_node2d->is_inside_tree()) {
Navigation2DServer::get_singleton()->agent_set_radius(agent, estimate_agent_radius());