Merge pull request #51463 from SaracenOne/assign_path_fix

Assign embedded text resource path earlier to prevent error on embedded scripts
This commit is contained in:
Rémi Verschelde 2021-08-10 08:13:14 +02:00 committed by GitHub
commit d56da233c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -558,6 +558,12 @@ Error ResourceLoaderText::load() {
resource_current++;
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);
res->set_scene_unique_id(id);
}
while (true) {
String assign;
Variant value;
@ -585,12 +591,6 @@ Error ResourceLoaderText::load() {
}
}
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);
res->set_scene_unique_id(id);
}
if (progress && resources_total > 0) {
*progress = resource_current / float(resources_total);
}