diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-07-26 15:48:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-26 15:48:45 +0200 |
commit | b5222c07846b4742425a001121d998fe92050c20 (patch) | |
tree | 265710dbdea30ff952d453b2627f61f94e40661e /editor | |
parent | 2d2b85d400e341e9b62a215e7fc2f3f73c075fe7 (diff) | |
parent | 063f66d73834bdf6643350e72cc063ea0ea23c4c (diff) |
Merge pull request #63488 from TokageItLab/fix-unique
Diffstat (limited to 'editor')
-rw-r--r-- | editor/scene_tree_dock.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 8cf0f50db8..ca1771bedf 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -1337,14 +1337,14 @@ void SceneTreeDock::_node_replace_owner(Node *p_base, Node *p_node, Node *p_root UndoRedo *undo_redo = &editor_data->get_undo_redo(); switch (p_mode) { case MODE_BIDI: { - bool is_unique = p_node->is_unique_name_in_owner() && p_base->get_node_or_null(UNIQUE_NODE_PREFIX + String(p_node->get_name())) != nullptr; - if (is_unique) { + bool disable_unique = p_node->is_unique_name_in_owner() && p_root->get_node_or_null(UNIQUE_NODE_PREFIX + String(p_node->get_name())) != nullptr; + if (disable_unique) { // Will create a unique name conflict. Disable before setting owner. undo_redo->add_do_method(p_node, "set_unique_name_in_owner", false); } undo_redo->add_do_method(p_node, "set_owner", p_root); undo_redo->add_undo_method(p_node, "set_owner", p_base); - if (is_unique) { + if (disable_unique) { // Will create a unique name conflict. Enable after setting owner. undo_redo->add_undo_method(p_node, "set_unique_name_in_owner", true); } |