summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorBojidar Marinov <bojidar.marinov.bg@gmail.com>2018-03-09 21:16:08 +0200
committerBojidar Marinov <bojidar.marinov.bg@gmail.com>2018-03-13 17:18:08 +0200
commit9f6c0c6eaef754f2049ee536c5b38bfdc65fbd08 (patch)
tree823f108360644d6403500810f31d08d7d5e37160 /scene/resources
parentb84236944215445be191047ab628e570ffd69e99 (diff)
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 'scene/resources')
-rw-r--r--scene/resources/packed_scene.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index 3df9285bb6..846f6e356e 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -249,6 +249,8 @@ Node *SceneState::instance(GenEditState p_edit_state) const {
//must make a copy, because this res is local to scene
}
}
+ } else if (p_edit_state == GEN_EDIT_STATE_INSTANCE) {
+ value = value.duplicate(true); // Duplicate arrays and dictionaries for the editor
}
node->set(snames[nprops[j].name], value, &valid);
}