Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] Fix NavigationObstacle not registering to default navigation map #66530

Merged
merged 1 commit into from
Sep 28, 2022

Conversation

timothyqiu
Copy link
Member

Fixes #64185

void NavigationObstacle::set_navigation(Navigation *p_nav) {
if (navigation == p_nav) {
return; // Pointless
}
navigation = p_nav;
if (navigation != nullptr) {
NavigationServer::get_singleton()->agent_set_map(agent, navigation->get_rid());
} else if (parent_spatial && parent_spatial->is_inside_tree()) {
NavigationServer::get_singleton()->agent_set_map(agent, parent_spatial->get_world()->get_navigation_map());
}
}

Don't skip set_navigation() when navigation is null. The else if branch should be executed as it does not depend on navigation.

@timothyqiu timothyqiu added bug topic:navigation cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release labels Sep 28, 2022
@timothyqiu timothyqiu added this to the 3.6 milestone Sep 28, 2022
@timothyqiu timothyqiu requested review from a team as code owners September 28, 2022 07:54
@akien-mga akien-mga merged commit d3662d0 into godotengine:3.x Sep 28, 2022
@akien-mga
Copy link
Member

Thanks!

@timothyqiu
Copy link
Member Author

Cherry-picked for 3.5.2

@timothyqiu timothyqiu removed the cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release label Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants