diff options
author | Bojidar Marinov <bojidar.marinov.bg@gmail.com> | 2018-03-09 21:16:08 +0200 |
---|---|---|
committer | Bojidar Marinov <bojidar.marinov.bg@gmail.com> | 2018-03-13 17:18:08 +0200 |
commit | 9f6c0c6eaef754f2049ee536c5b38bfdc65fbd08 (patch) | |
tree | 823f108360644d6403500810f31d08d7d5e37160 /core/dictionary.cpp | |
parent | b84236944215445be191047ab628e570ffd69e99 (diff) | |
download | redot-engine-9f6c0c6eaef754f2049ee536c5b38bfdc65fbd08.tar.gz |
Duplicate Arrays and Dictionaries when instancing scene in editor
Also, add deep (=false) parameter to Array.duplicate and Dictionary.duplicate
Fixes #13971
Diffstat (limited to 'core/dictionary.cpp')
-rw-r--r-- | core/dictionary.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/dictionary.cpp b/core/dictionary.cpp index e3f4aa5f28..ba0de95861 100644 --- a/core/dictionary.cpp +++ b/core/dictionary.cpp @@ -211,7 +211,7 @@ const Variant *Dictionary::next(const Variant *p_key) const { return NULL; } -Dictionary Dictionary::duplicate() const { +Dictionary Dictionary::duplicate(bool p_deep) const { Dictionary n; @@ -219,7 +219,7 @@ Dictionary Dictionary::duplicate() const { get_key_list(&keys); for (List<Variant>::Element *E = keys.front(); E; E = E->next()) { - n[E->get()] = operator[](E->get()); + n[E->get()] = p_deep ? operator[](E->get()).duplicate(p_deep) : operator[](E->get()); } return n; |