Merge pull request #103769 from AeioMuch/fix_copy_paste_to_new_scene

Fix ownership when pasting non root with child nodes in new scene
This commit is contained in:
Rémi Verschelde 2025-03-12 22:57:09 +01:00
commit 0ca46bfcbd
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -4268,7 +4268,7 @@ List<Node *> SceneTreeDock::paste_nodes(bool p_paste_as_sibling) {
// and added to the node_clipboard_edited_scene_owned list.
if (d != dup && E2.key->get_owner() == nullptr) {
if (node_clipboard_edited_scene_owned.find(const_cast<Node *>(E2.key))) {
ur->add_do_method(d, "set_owner", edited_scene);
ur->add_do_method(d, "set_owner", owner);
}
}
}