summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-02-12 12:48:00 +0100
committerGitHub <noreply@github.com>2022-02-12 12:48:00 +0100
commitb50ec3753e24eea658c00b052388b626a28e08d2 (patch)
treebdb947819a945667296cbe1b85143f36fc371911
parentb99fad040d77719f5852e644a85a1488b65d7811 (diff)
parent97feafd0ea67580c91c699ed58d771cc80842e32 (diff)
Merge pull request #58007 from reduz/fix-resoure-reuse-in-binary-loader
-rw-r--r--core/io/resource_format_binary.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp
index 8588bab0be..ed58b4be7b 100644
--- a/core/io/resource_format_binary.cpp
+++ b/core/io/resource_format_binary.cpp
@@ -678,11 +678,13 @@ Error ResourceLoaderBinary::load() {
internal_resources.write[i].path = path; // Update path.
}
- if (cache_mode == ResourceFormatLoader::CACHE_MODE_REUSE) {
- if (ResourceCache::has(path)) {
+ if (cache_mode == ResourceFormatLoader::CACHE_MODE_REUSE && ResourceCache::has(path)) {
+ RES cached = ResourceCache::get(path);
+ if (cached.is_valid()) {
//already loaded, don't do anything
stage++;
error = OK;
+ internal_index_cache[path] = cached;
continue;
}
}