diff options
author | kobewi <kobewi4e@gmail.com> | 2023-01-28 16:20:03 +0100 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2023-02-07 14:13:22 +0100 |
commit | 095c8050798be4ae89b8ab66a25a9864778def88 (patch) | |
tree | 3e786f5bb64a5d9f3213f1bb09fafbea06f54155 /scene/resources | |
parent | bdad9770d64914da3b77bee49916419b5df87d1c (diff) |
Fix sub-resource IDs resetting when preloaded
Diffstat (limited to 'scene/resources')
-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); } |