summaryrefslogtreecommitdiffstats
path: root/scene/main/node.cpp
diff options
context:
space:
mode:
authorwarriormaster12 <streng.alexander@outlook.com>2024-06-02 13:27:35 +0300
committerwarriormaster12 <streng.alexander@outlook.com>2024-06-02 13:27:35 +0300
commite4d0d1344b68796cba86a6c60be1275316748116 (patch)
treea8ba98d76dc99e37e68f621c81760446242d758f /scene/main/node.cpp
parent705b7a0b0bd535c95e4e8fb439f3d84b3fb4f427 (diff)
downloadredot-engine-e4d0d1344b68796cba86a6c60be1275316748116.tar.gz
Duplicate properties first before remapping resources
Diffstat (limited to 'scene/main/node.cpp')
-rw-r--r--scene/main/node.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 884fc6de07..e9e40a222e 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -2771,12 +2771,12 @@ Node *Node::duplicate(int p_flags) const {
ERR_THREAD_GUARD_V(nullptr);
Node *dupe = _duplicate(p_flags);
+ _duplicate_properties(this, this, dupe, p_flags);
+
if (dupe && (p_flags & DUPLICATE_SIGNALS)) {
_duplicate_signals(this, dupe);
}
- _duplicate_properties(this, this, dupe, p_flags);
-
return dupe;
}
@@ -2789,6 +2789,8 @@ Node *Node::duplicate_from_editor(HashMap<const Node *, Node *> &r_duplimap, con
int flags = DUPLICATE_SIGNALS | DUPLICATE_GROUPS | DUPLICATE_SCRIPTS | DUPLICATE_USE_INSTANTIATION | DUPLICATE_FROM_EDITOR;
Node *dupe = _duplicate(flags, &r_duplimap);
+ _duplicate_properties(this, this, dupe, flags);
+
// This is used by SceneTreeDock's paste functionality. When pasting to foreign scene, resources are duplicated.
if (!p_resource_remap.is_empty()) {
remap_node_resources(dupe, p_resource_remap);
@@ -2799,8 +2801,6 @@ Node *Node::duplicate_from_editor(HashMap<const Node *, Node *> &r_duplimap, con
// if the emitter node comes later in tree order than the receiver
_duplicate_signals(this, dupe);
- _duplicate_properties(this, this, dupe, flags);
-
return dupe;
}