From 0ebbc5b07c32b1b621d06c503e4308ff0316e550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Wed, 17 Nov 2021 14:00:23 +0100 Subject: [PATCH] Fix crash when loading scene instance after node vanished from parent (cherry picked from commit 78ffc2a987ed672c7fd9d2fa9f3e74ee047f917f) --- scene/resources/packed_scene.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index d5a8c978e89..379b799dcbf 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -313,13 +313,13 @@ Node *SceneState::instance(GenEditState p_edit_state) const { node->_set_owner_nocheck(owner); } } - } - // we only want to deal with pinned flag if instancing as pure main (no instance, no inheriting) - if (p_edit_state == GEN_EDIT_STATE_MAIN) { - _sanitize_node_pinned_properties(node); - } else { - node->remove_meta("_edit_pinned_properties_"); + // we only want to deal with pinned flag if instancing as pure main (no instance, no inheriting) + if (p_edit_state == GEN_EDIT_STATE_MAIN) { + _sanitize_node_pinned_properties(node); + } else { + node->remove_meta("_edit_pinned_properties_"); + } } ret_nodes[i] = node;