mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Merge pull request #100235 from akien-mga/revert-97303
Revert "Avoid duplicating signals from scene instances into packed scenes"
This commit is contained in:
@@ -572,7 +572,7 @@ public:
|
|||||||
CONNECT_PERSIST = 2, // hint for scene to save this connection
|
CONNECT_PERSIST = 2, // hint for scene to save this connection
|
||||||
CONNECT_ONE_SHOT = 4,
|
CONNECT_ONE_SHOT = 4,
|
||||||
CONNECT_REFERENCE_COUNTED = 8,
|
CONNECT_REFERENCE_COUNTED = 8,
|
||||||
CONNECT_INHERITED = 16, // Whether or not the connection is in an instance of a scene.
|
CONNECT_INHERITED = 16, // Used in editor builds.
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Connection {
|
struct Connection {
|
||||||
|
|||||||
@@ -1060,12 +1060,6 @@ Error SceneState::_parse_connections(Node *p_owner, Node *p_node, HashMap<String
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't include signals that are from scene instances
|
|
||||||
// (they are already saved in the scenes themselves).
|
|
||||||
if (c.flags & CONNECT_INHERITED) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// only connections that originate or end into main saved scene are saved
|
// only connections that originate or end into main saved scene are saved
|
||||||
// everything else is discarded
|
// everything else is discarded
|
||||||
|
|
||||||
|
|||||||
@@ -96,6 +96,8 @@ TEST_CASE("[PackedScene] Signals Preserved when Packing Scene") {
|
|||||||
CHECK_EQ(state->get_connection_count(), 3);
|
CHECK_EQ(state->get_connection_count(), 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// FIXME: This subcase requires GH-48064 to be fixed.
|
||||||
SUBCASE("Signals that should not be saved") {
|
SUBCASE("Signals that should not be saved") {
|
||||||
int subscene_flags = Object::CONNECT_PERSIST | Object::CONNECT_INHERITED;
|
int subscene_flags = Object::CONNECT_PERSIST | Object::CONNECT_INHERITED;
|
||||||
// subscene node to itself
|
// subscene node to itself
|
||||||
@@ -115,6 +117,7 @@ TEST_CASE("[PackedScene] Signals Preserved when Packing Scene") {
|
|||||||
Ref<SceneState> state = packed_scene->get_state();
|
Ref<SceneState> state = packed_scene->get_state();
|
||||||
CHECK_EQ(state->get_connection_count(), 0);
|
CHECK_EQ(state->get_connection_count(), 0);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
memdelete(main_scene_root);
|
memdelete(main_scene_root);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user