Skip to content

Commit

Permalink
Merge pull request #76378 from KoBeWi/fix_typed_array_export_2-fix_ha…
Browse files Browse the repository at this point in the history
…rder

Fix typed array export... again
  • Loading branch information
akien-mga authored Apr 26, 2023
2 parents 6bf94cf + da8d673 commit e2e870c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion editor/editor_properties_array_dict.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e2e870c

Please sign in to comment.