From 2a3129847ada4760ff645738497df5b49f8b6191 Mon Sep 17 00:00:00 2001 From: cixil Date: Mon, 30 Dec 2024 20:17:40 -0500 Subject: [PATCH] PackedScene: Avoid saving signal connections twice --- editor/export/editor_export_platform.cpp | 2 +- scene/resources/packed_scene.cpp | 5 +++++ tests/scene/test_packed_scene.h | 3 --- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp index cb496fc9f09e..3cdc578846b4 100644 --- a/editor/export/editor_export_platform.cpp +++ b/editor/export/editor_export_platform.cpp @@ -822,7 +822,7 @@ String EditorExportPlatform::_export_customize(const String &p_path, LocalVector if (type == "PackedScene") { // Its a scene. Ref ps = ResourceLoader::load(p_path, "PackedScene", ResourceFormatLoader::CACHE_MODE_IGNORE); ERR_FAIL_COND_V(ps.is_null(), p_path); - Node *node = ps->instantiate(PackedScene::GEN_EDIT_STATE_INSTANCE); // Make sure the child scene root gets the correct inheritance chain. + Node *node = ps->instantiate(PackedScene::GEN_EDIT_STATE_MAIN); // Make sure scene root gets the correct inheritance chain. ERR_FAIL_NULL_V(node, p_path); if (!customize_scenes_plugins.is_empty()) { for (Ref &plugin : customize_scenes_plugins) { diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 7f170e0085ec..5a5ffba9f515 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -1059,6 +1059,11 @@ Error SceneState::_parse_connections(Node *p_owner, Node *p_node, HashMapget_connection_count(), 3); } - /* - // FIXME: This subcase requires GH-48064 to be fixed. SUBCASE("Signals that should not be saved") { int subscene_flags = Object::CONNECT_PERSIST | Object::CONNECT_INHERITED; // subscene node to itself @@ -117,7 +115,6 @@ TEST_CASE("[PackedScene] Signals Preserved when Packing Scene") { Ref state = packed_scene->get_state(); CHECK_EQ(state->get_connection_count(), 0); } - */ memdelete(main_scene_root); }