Skip to content

Commit

Permalink
Actually use loaded resource cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Razoric480 committed Aug 27, 2023
1 parent 17b403a commit 17d8c09
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion core/io/resource_format_binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,18 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
path = ProjectSettings::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
}

RES res = ResourceLoader::load(path, exttype, no_subresource_cache);
RES res;

for (List<RES>::Element *E = resource_cache.front(); E; E = E->next()) {
if (E->get()->get_path() == path) {
res = E->get();
break;
}
}

if (res.is_null()) {
res = ResourceLoader::load(path, exttype, no_subresource_cache);
}

if (res.is_null()) {
WARN_PRINT(String("Couldn't load resource: " + path).utf8().get_data());
Expand Down

0 comments on commit 17d8c09

Please sign in to comment.