From 17d8c09a8c7dd1b4be65e63d960051002118341f Mon Sep 17 00:00:00 2001 From: Francois Belair Date: Sat, 26 Aug 2023 17:50:52 -0400 Subject: [PATCH] Actually use loaded resource cache --- core/io/resource_format_binary.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index e395acf29a85..fb6128515b1d 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -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::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());