diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-06-26 10:12:19 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-06-26 10:12:19 +0200 |
commit | 710d2e7edf54c477a15c7bc3fb91ead394b51fd9 (patch) | |
tree | f25e8a5e405ef98417a19f4943ca185da768ec4e /modules/navigation/nav_region.cpp | |
parent | a93c671b7d59d9d9be76558a8cc53bd87a0f42d1 (diff) | |
parent | 4ae5dcca4563743d6c09c67e262c516020174fc4 (diff) | |
download | redot-engine-710d2e7edf54c477a15c7bc3fb91ead394b51fd9.tar.gz |
Merge pull request #78665 from smix8/fix_navobjects_map_4.x
Fix NavObjects map assignments
Diffstat (limited to 'modules/navigation/nav_region.cpp')
-rw-r--r-- | modules/navigation/nav_region.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/navigation/nav_region.cpp b/modules/navigation/nav_region.cpp index bf4fec1ac8..867cf5d8fc 100644 --- a/modules/navigation/nav_region.cpp +++ b/modules/navigation/nav_region.cpp @@ -36,10 +36,18 @@ void NavRegion::set_map(NavMap *p_map) { if (map == p_map) { return; } + + if (map) { + map->remove_region(this); + } + map = p_map; polygons_dirty = true; - if (!map) { - connections.clear(); + + connections.clear(); + + if (map) { + map->add_region(this); } } |