diff options
| author | AndreaCatania | 2018-01-11 19:50:33 +0100 |
|---|---|---|
| committer | AndreaCatania | 2018-01-11 19:50:33 +0100 |
| commit | 5ac441131ee83e535600af07212764e322cd16ce (patch) | |
| tree | a1dce7fbefa0a7d4b62e235eb1b043ec2de31050 /scene/main/node.cpp | |
| parent | 4b414f45c47d699da4442ac2347c3b1684616cc0 (diff) | |
| download | godot-5ac441131ee83e535600af07212764e322cd16ce.tar.gz godot-5ac441131ee83e535600af07212764e322cd16ce.tar.zst godot-5ac441131ee83e535600af07212764e322cd16ce.zip | |
Diffstat (limited to 'scene/main/node.cpp')
| -rw-r--r-- | scene/main/node.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index a36f39802..bc03d322b 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -2169,7 +2169,16 @@ Node *Node::_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap) const value = Array(value).duplicate(); } - current_node->set(name, value); + if (E->get().usage & PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE) { + + Resource *res = Object::cast_to<Resource>(value); + if (res) // Duplicate only if it's a resource + current_node->set(name, res->duplicate()); + + } else { + + current_node->set(name, value); + } } } |
