Browse Source

Joint2D and Joint3D: disconnect only connected signals

Ricardo Buring 3 years ago
parent
commit
184105e753
2 changed files with 6 additions and 6 deletions
  1. 3 3
      scene/2d/joint_2d.cpp
  2. 3 3
      scene/3d/joint_3d.cpp

+ 3 - 3
scene/2d/joint_2d.cpp

@@ -128,7 +128,7 @@ void Joint2D::set_node_a(const NodePath &p_node_a) {
 		return;
 		return;
 	}
 	}
 
 
-	if (joint.is_valid()) {
+	if (is_configured()) {
 		_disconnect_signals();
 		_disconnect_signals();
 	}
 	}
 
 
@@ -145,7 +145,7 @@ void Joint2D::set_node_b(const NodePath &p_node_b) {
 		return;
 		return;
 	}
 	}
 
 
-	if (joint.is_valid()) {
+	if (is_configured()) {
 		_disconnect_signals();
 		_disconnect_signals();
 	}
 	}
 
 
@@ -164,7 +164,7 @@ void Joint2D::_notification(int p_what) {
 		} break;
 		} break;
 
 
 		case NOTIFICATION_EXIT_TREE: {
 		case NOTIFICATION_EXIT_TREE: {
-			if (joint.is_valid()) {
+			if (is_configured()) {
 				_disconnect_signals();
 				_disconnect_signals();
 				_update_joint(true);
 				_update_joint(true);
 			}
 			}

+ 3 - 3
scene/3d/joint_3d.cpp

@@ -124,7 +124,7 @@ void Joint3D::set_node_a(const NodePath &p_node_a) {
 		return;
 		return;
 	}
 	}
 
 
-	if (joint.is_valid()) {
+	if (is_configured()) {
 		_disconnect_signals();
 		_disconnect_signals();
 	}
 	}
 
 
@@ -141,7 +141,7 @@ void Joint3D::set_node_b(const NodePath &p_node_b) {
 		return;
 		return;
 	}
 	}
 
 
-	if (joint.is_valid()) {
+	if (is_configured()) {
 		_disconnect_signals();
 		_disconnect_signals();
 	}
 	}
 
 
@@ -171,7 +171,7 @@ void Joint3D::_notification(int p_what) {
 		} break;
 		} break;
 
 
 		case NOTIFICATION_EXIT_TREE: {
 		case NOTIFICATION_EXIT_TREE: {
-			if (joint.is_valid()) {
+			if (is_configured()) {
 				_disconnect_signals();
 				_disconnect_signals();
 				_update_joint(true);
 				_update_joint(true);
 			}
 			}