Skip to content

Commit

Permalink
Merge pull request #72492 from maiself/fix-binary-res-typed-array
Browse files Browse the repository at this point in the history
Fix loading of binary resources with typed arrays
  • Loading branch information
akien-mga committed Feb 1, 2023
2 parents 9aeda3b + 87e6885 commit 68299e0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/io/resource_format_binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 68299e0

Please sign in to comment.