summaryrefslogtreecommitdiffstats
path: root/modules/gridmap/grid_map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gridmap/grid_map.cpp')
-rw-r--r--modules/gridmap/grid_map.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index c77fa98be2..f1e2218434 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -258,11 +258,11 @@ RID GridMap::get_navigation_map() const {
void GridMap::set_mesh_library(const Ref<MeshLibrary> &p_mesh_library) {
if (!mesh_library.is_null()) {
- mesh_library->unregister_owner(this);
+ mesh_library->disconnect_changed(callable_mp(this, &GridMap::_recreate_octant_data));
}
mesh_library = p_mesh_library;
if (!mesh_library.is_null()) {
- mesh_library->register_owner(this);
+ mesh_library->connect_changed(callable_mp(this, &GridMap::_recreate_octant_data));
}
_recreate_octant_data();
@@ -1005,9 +1005,10 @@ void GridMap::clear() {
clear_baked_meshes();
}
+#ifndef DISABLE_DEPRECATED
void GridMap::resource_changed(const Ref<Resource> &p_res) {
- _recreate_octant_data();
}
+#endif
void GridMap::_update_octants_callback() {
if (!awaiting_update) {
@@ -1079,7 +1080,9 @@ void GridMap::_bind_methods() {
ClassDB::bind_method(D_METHOD("map_to_local", "map_position"), &GridMap::map_to_local);
ClassDB::bind_method(D_METHOD("_update_octants_callback"), &GridMap::_update_octants_callback);
+#ifndef DISABLE_DEPRECATED
ClassDB::bind_method(D_METHOD("resource_changed", "resource"), &GridMap::resource_changed);
+#endif
ClassDB::bind_method(D_METHOD("set_center_x", "enable"), &GridMap::set_center_x);
ClassDB::bind_method(D_METHOD("get_center_x"), &GridMap::get_center_x);
@@ -1336,10 +1339,6 @@ void GridMap::_navigation_map_changed(RID p_map) {
#endif // DEBUG_ENABLED
GridMap::~GridMap() {
- if (!mesh_library.is_null()) {
- mesh_library->unregister_owner(this);
- }
-
clear();
#ifdef DEBUG_ENABLED
NavigationServer3D::get_singleton()->disconnect("map_changed", callable_mp(this, &GridMap::_navigation_map_changed));