Fix NavigationObstacle not registering to default navigation map

This commit is contained in:
Haoyu Qiu 2022-09-28 15:49:26 +08:00 committed by Relintai
parent a3ed238e40
commit dbd2b16a35
2 changed files with 2 additions and 2 deletions

View File

@ -135,7 +135,7 @@ NavigationObstacle2D::~NavigationObstacle2D() {
}
void NavigationObstacle2D::set_navigation(Navigation2D *p_nav) {
if (navigation == p_nav) {
if (navigation == p_nav && navigation != nullptr) {
return; // Pointless
}

View File

@ -142,7 +142,7 @@ NavigationObstacle::~NavigationObstacle() {
}
void NavigationObstacle::set_navigation(Navigation *p_nav) {
if (navigation == p_nav) {
if (navigation == p_nav && navigation != nullptr) {
return; // Pointless
}