aboutsummaryrefslogtreecommitdiff
path: root/core/dictionary.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2018-04-08 09:39:03 -0300
committerGitHub2018-04-08 09:39:03 -0300
commit4ee3f3251dc55ae49c873bc1895cecf75bc0bf8a (patch)
treead5442ba88596748b67ec6834a50b61543c8d916 /core/dictionary.cpp
parent8a5fb669ae3590fa1aa3f1fb90d01c3dca843c94 (diff)
parent9f6c0c6eaef754f2049ee536c5b38bfdc65fbd08 (diff)
downloadgodot-4ee3f3251dc55ae49c873bc1895cecf75bc0bf8a.tar.gz
godot-4ee3f3251dc55ae49c873bc1895cecf75bc0bf8a.tar.zst
godot-4ee3f3251dc55ae49c873bc1895cecf75bc0bf8a.zip
Merge pull request #17382 from bojidar-bg/13971-path-array-unsaved
Duplicate Arrays and Dictionaries when instancing scene in editor
Diffstat (limited to '')
-rw-r--r--core/dictionary.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/dictionary.cpp b/core/dictionary.cpp
index e3f4aa5f2..ba0de9586 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;