diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-07-02 15:08:35 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2018-07-02 15:08:35 -0300 |
commit | 2dc738ce2733757631a4ccf413a92411c4400246 (patch) | |
tree | de7d355ea5a2e90e2dbebd6044517cf2b63b090a /core/variant_op.cpp | |
parent | ecee0c92ff86911fa50e745b4ab98196e0d2afe4 (diff) | |
download | redot-engine-2dc738ce2733757631a4ccf413a92411c4400246.tar.gz |
-Fixes to how hashing happened, now StringName and NodePath use default hasher, this was leading to some severe slowdown in scenarios
-Fixes to some duplication scenarios for instanced scenes
Diffstat (limited to 'core/variant_op.cpp')
-rw-r--r-- | core/variant_op.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/core/variant_op.cpp b/core/variant_op.cpp index 621af2dfb7..983c3e18bc 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -3417,8 +3417,15 @@ Variant Variant::iter_get(const Variant &r_iter, bool &r_valid) const { Variant Variant::duplicate(bool deep) const { switch (type) { - // case OBJECT: - // return operator Object *()->duplicate(); + case OBJECT: { + if (deep && !_get_obj().ref.is_null()) { + Ref<Resource> resource = _get_obj().ref; + if (resource.is_valid()) { + return resource->duplicate(true); + } + } + return *this; + } break; case DICTIONARY: return operator Dictionary().duplicate(deep); case ARRAY: |