diff options
Diffstat (limited to 'scene/resources/packed_scene.cpp')
-rw-r--r-- | scene/resources/packed_scene.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index e497a628aa..7984ec735e 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -314,7 +314,19 @@ Node *SceneState::instantiate(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) { + } + if (value.get_type() == Variant::ARRAY) { + Array set_array = value; + bool is_get_valid = false; + Variant get_value = node->get(snames[nprops[j].name], &is_get_valid); + if (is_get_valid && get_value.get_type() == Variant::ARRAY) { + Array get_array = get_value; + if (!set_array.is_same_typed(get_array)) { + value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script()); + } + } + } + if (p_edit_state == GEN_EDIT_STATE_INSTANCE && value.get_type() != Variant::OBJECT) { value = value.duplicate(true); // Duplicate arrays and dictionaries for the editor } |