diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-07 16:30:06 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-07 16:30:06 +0100 |
commit | 07d46da48594b99be5e41817ec9268d179fc01ec (patch) | |
tree | 9956501ef6c2ec3f1f1428b664278959f60e63ef | |
parent | 98921d8fbaa83f53f0205ea77f522e37ba30ead2 (diff) | |
parent | 095c8050798be4ae89b8ab66a25a9864778def88 (diff) |
Merge pull request #72257 from KoBeWi/potential_fix_or_maybe_not_who_knows
Fix sub-resource IDs resetting when preloaded
-rw-r--r-- | scene/resources/resource_format_text.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 3006da5309..448e800900 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -601,9 +601,11 @@ Error ResourceLoaderText::load() { *progress = resource_current / float(resources_total); } - int_resources[id] = res; //always assign int resources - if (do_assign && cache_mode != ResourceFormatLoader::CACHE_MODE_IGNORE) { - res->set_path(path, cache_mode == ResourceFormatLoader::CACHE_MODE_REPLACE); + int_resources[id] = res; // Always assign int resources. + if (do_assign) { + if (cache_mode != ResourceFormatLoader::CACHE_MODE_IGNORE) { + res->set_path(path, cache_mode == ResourceFormatLoader::CACHE_MODE_REPLACE); + } res->set_scene_unique_id(id); } |