Fix NavigationObstacle not registering to default navigation map

This commit is contained in:
Haoyu Qiu 2022-09-28 15:49:26 +08:00
parent 7104647c65
commit fba5a4ab9a
2 changed files with 2 additions and 2 deletions

View file

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

View file

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