Skip to content

Commit

Permalink
Merge pull request #61966 from Rindbee/fix-internal-nodes-owned
Browse files Browse the repository at this point in the history
Fix setting owner on internal nodes when save branch as scene
  • Loading branch information
akien-mga authored Jun 23, 2022
2 parents 49d061f + 472d16b commit 91b984a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions editor/scene_tree_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 91b984a

Please sign in to comment.