Browse Source

Assign embedded text resource path earlier to prevent error on embedded scripts.

SaracenOne 4 years ago
parent
commit
d00c151db1
1 changed files with 6 additions and 6 deletions
  1. 6 6
      scene/resources/resource_format_text.cpp

+ 6 - 6
scene/resources/resource_format_text.cpp

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