diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-01-11 16:44:18 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-11 16:44:18 -0300 |
commit | 9a6282975938106d17ccd49ef1b8c7fc4b11b3d2 (patch) | |
tree | 99ea03bf071b792ceb4d65a511173b3190f1dba9 /scene/main/node.cpp | |
parent | b63384a9f1d318d22f67519de8c93144d45251bb (diff) | |
parent | 09a6a74074332b964316683fdfca90094f40a2f5 (diff) |
Merge pull request #15531 from AndreaCatania/p2
Fixed crash on duplicate GIProbe baking
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 a36f398024..bc03d322b6 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); + } } } |