From a0715b30f94430078422ff05d81b9cfa85ddb4ce Mon Sep 17 00:00:00 2001 From: Josh Jones Date: Wed, 21 Dec 2022 14:21:43 -0800 Subject: Rework const on NavigationServer methods `const` is used on all methods, even when they cause modification of the server. This reworks the methods of the server to only use `const` on method that don't change the state of the server. --- modules/gridmap/grid_map.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'modules/gridmap') diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index faee36fb82..3c0bd56e86 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -1310,8 +1310,8 @@ RID GridMap::get_bake_mesh_instance(int p_idx) { GridMap::GridMap() { set_notify_transform(true); #ifdef DEBUG_ENABLED - NavigationServer3D::get_singleton_mut()->connect("map_changed", callable_mp(this, &GridMap::_navigation_map_changed)); - NavigationServer3D::get_singleton_mut()->connect("navigation_debug_changed", callable_mp(this, &GridMap::_update_navigation_debug_edge_connections)); + NavigationServer3D::get_singleton()->connect("map_changed", callable_mp(this, &GridMap::_navigation_map_changed)); + NavigationServer3D::get_singleton()->connect("navigation_debug_changed", callable_mp(this, &GridMap::_update_navigation_debug_edge_connections)); #endif // DEBUG_ENABLED } @@ -1338,8 +1338,8 @@ GridMap::~GridMap() { clear(); #ifdef DEBUG_ENABLED - NavigationServer3D::get_singleton_mut()->disconnect("map_changed", callable_mp(this, &GridMap::_navigation_map_changed)); - NavigationServer3D::get_singleton_mut()->disconnect("navigation_debug_changed", callable_mp(this, &GridMap::_update_navigation_debug_edge_connections)); + NavigationServer3D::get_singleton()->disconnect("map_changed", callable_mp(this, &GridMap::_navigation_map_changed)); + NavigationServer3D::get_singleton()->disconnect("navigation_debug_changed", callable_mp(this, &GridMap::_update_navigation_debug_edge_connections)); #endif // DEBUG_ENABLED } @@ -1421,7 +1421,7 @@ void GridMap::_update_octant_navigation_debug_edge_connections_mesh(const Octant return; } - Ref edge_connections_material = NavigationServer3D::get_singleton_mut()->get_debug_navigation_edge_connections_material(); + Ref edge_connections_material = NavigationServer3D::get_singleton()->get_debug_navigation_edge_connections_material(); Array mesh_array; mesh_array.resize(Mesh::ARRAY_MAX); -- cgit v1.2.3