summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-02-01 08:02:28 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-02-01 08:02:28 +0100
commit68299e0f947fa0ef0c95b9de816b270ad756e4ff (patch)
treedf61824fc8380c385dab3988218f68ac5604ad39 /core/io
parent9aeda3b28222733d7a2a1175e32fca78560504fe (diff)
parent87e6885f5ef36bddbbdaebf69a611e9d040c0cc5 (diff)
Merge pull request #72492 from maiself/fix-binary-res-typed-array
Fix loading of binary resources with typed arrays
Diffstat (limited to 'core/io')
-rw-r--r--core/io/resource_format_binary.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp
index c0463de427..38f41d645c 100644
--- a/core/io/resource_format_binary.cpp
+++ b/core/io/resource_format_binary.cpp
@@ -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);
}