diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-06-23 14:08:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-23 14:08:12 +0200 |
commit | 91b984a507a7dc6da017220bb02b4e7fe1abc4be (patch) | |
tree | f503a18f203f4a1b25d17d551547c11e8914a432 /editor | |
parent | 49d061f8fc39c35a175d098d083558c93769010c (diff) | |
parent | 472d16be4fc44061121a3181e1be4c573520ea54 (diff) |
Merge pull request #61966 from Rindbee/fix-internal-nodes-owned
Fix setting owner on internal nodes when save branch as scene
Diffstat (limited to 'editor')
-rw-r--r-- | editor/scene_tree_dock.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 08df4cdf3c..2e1090e6c0 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -2418,8 +2418,8 @@ void SceneTreeDock::_new_scene_from(String p_file) { Node *copy = base->duplicate_from_editor(duplimap); if (copy) { - for (int i = 0; i < copy->get_child_count(); i++) { - _set_node_owner_recursive(copy->get_child(i), copy); + for (int i = 0; i < copy->get_child_count(false); i++) { + _set_node_owner_recursive(copy->get_child(i, false), copy); } Ref<PackedScene> sdata = memnew(PackedScene); @@ -2456,8 +2456,8 @@ void SceneTreeDock::_set_node_owner_recursive(Node *p_node, Node *p_owner) { p_node->set_owner(p_owner); } - for (int i = 0; i < p_node->get_child_count(); i++) { - _set_node_owner_recursive(p_node->get_child(i), p_owner); + for (int i = 0; i < p_node->get_child_count(false); i++) { + _set_node_owner_recursive(p_node->get_child(i, false), p_owner); } } |