diff options
author | kobewi <kobewi4e@gmail.com> | 2023-04-23 20:08:30 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2023-04-23 20:08:30 +0200 |
commit | da8d6734fbc31f68e7e822f37fd239a92ac79b34 (patch) | |
tree | 4224c3425e15fc7bf419521d50ee60c15a00c8ae | |
parent | 24cb43a8741c7b10abbbbc77bb6e2bc188662ce0 (diff) | |
download | redot-engine-da8d6734fbc31f68e7e822f37fd239a92ac79b34.tar.gz |
Fix typed array export... again
-rw-r--r-- | editor/editor_properties_array_dict.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index bb0434a1bf..3345f87973 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -203,7 +203,18 @@ void EditorPropertyArray::_property_changed(const String &p_property, Variant p_ index = p_property.get_slice("/", 1).to_int(); } - Variant array = object->get_array().duplicate(); + Variant array; + const Variant &original_array = object->get_array(); + + if (original_array.get_type() == Variant::ARRAY) { + // Needed to preserve type of TypedArrays in meta pointer properties. + Array temp; + temp.assign(original_array.duplicate()); + array = temp; + } else { + array = original_array.duplicate(); + } + array.set(index, p_value); object->set_array(array); emit_changed(get_edited_property(), array, "", true); |