From 5ace0cd58fe1ba42ad87652591ae108cdc5b4b38 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 6 Jun 2023 23:17:46 +0200 Subject: [PATCH] Fix signal double connection. --- scene/2d/navigation_polygon_instance.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/scene/2d/navigation_polygon_instance.cpp b/scene/2d/navigation_polygon_instance.cpp index c79d9af9d..8f1c86d2c 100644 --- a/scene/2d/navigation_polygon_instance.cpp +++ b/scene/2d/navigation_polygon_instance.cpp @@ -58,9 +58,6 @@ void NavigationPolygonInstance::set_enabled(bool p_enabled) { if (!enabled) { Navigation2DServer::get_singleton()->region_set_map(region, RID()); -#ifdef DEBUG_ENABLED - Navigation2DServer::get_singleton_mut()->disconnect("map_changed", this, "_navigation_map_changed"); -#endif } else { if (navigation != nullptr) { Navigation2DServer::get_singleton()->region_set_map(region, navigation->get_rid()); @@ -71,9 +68,6 @@ void NavigationPolygonInstance::set_enabled(bool p_enabled) { Navigation2DServer::get_singleton()->region_set_map(region, get_world_2d()->get_navigation_map()); } } -#ifdef DEBUG_ENABLED - Navigation2DServer::get_singleton_mut()->connect("map_changed", this, "_navigation_map_changed"); -#endif } #ifdef DEBUG_ENABLED @@ -166,12 +160,6 @@ void NavigationPolygonInstance::_notification(int p_what) { Navigation2DServer::get_singleton()->region_set_map(region, get_world_2d()->get_navigation_map()); } } - -#ifdef DEBUG_ENABLED - if (enabled) { - Navigation2DServer::get_singleton_mut()->connect("map_changed", this, "_navigation_map_changed"); - } -#endif } break; case NOTIFICATION_TRANSFORM_CHANGED: { Navigation2DServer::get_singleton()->region_set_transform(region, get_global_transform()); @@ -181,12 +169,6 @@ void NavigationPolygonInstance::_notification(int p_what) { Navigation2DServer::get_singleton()->region_set_map(region, RID()); } navigation = nullptr; - -#ifdef DEBUG_ENABLED - if (enabled) { - Navigation2DServer::get_singleton_mut()->disconnect("map_changed", this, "_navigation_map_changed"); - } -#endif } break; case NOTIFICATION_DRAW: { #ifdef DEBUG_ENABLED