Merge pull request #72492 from maiself/fix-binary-res-typed-array

Fix loading of binary resources with typed arrays
This commit is contained in:
Rémi Verschelde 2023-02-01 08:02:28 +01:00
commit 68299e0f94
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -832,6 +832,18 @@ Error ResourceLoaderBinary::load() {
}
}
if (value.get_type() == Variant::ARRAY) {
Array set_array = value;
bool is_get_valid = false;
Variant get_value = res->get(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 (set_valid) {
res->set(name, value);
}