summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorMicky <micheledevita2@gmail.com>2022-12-06 13:50:54 +0100
committerMicky <micheledevita2@gmail.com>2022-12-08 13:36:48 +0100
commit885f2a4eca0f348e8d04e45e6e9a0e950f4c6964 (patch)
tree554b93f867a413d82c3e020c475d0c095824cb42 /scene/resources
parentf3e6750a7e4702918e05f42b1376e30e652f2f90 (diff)
Fix unable to disconnect signal in Editor once created
Adds a CONNECT_INHERITED flag to connections, only available in editor builds. This flag denotes that the signal has been inherited from a previous Scene in the instancing hierarchy.
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/packed_scene.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index f4b7f3d0b2..5316b524ba 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -450,7 +450,7 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const {
callable = callable.bindp(argptrs, binds.size());
}
- cfrom->connect(snames[c.signal], callable, CONNECT_PERSIST | c.flags);
+ cfrom->connect(snames[c.signal], callable, CONNECT_PERSIST | c.flags | (p_edit_state == GEN_EDIT_STATE_MAIN ? 0 : CONNECT_INHERITED));
}
//Node *s = ret_nodes[0];