|
@@ -2596,20 +2596,12 @@ Ref<GDScript> GDScriptLanguage::get_script_by_fully_qualified_name(const String
|
|
|
/*************** RESOURCE ***************/
|
|
|
|
|
|
Ref<Resource> ResourceFormatLoaderGDScript::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, CacheMode p_cache_mode) {
|
|
|
- if (r_error) {
|
|
|
- *r_error = ERR_FILE_CANT_OPEN;
|
|
|
- }
|
|
|
-
|
|
|
Error err;
|
|
|
Ref<GDScript> scr = GDScriptCache::get_full_script(p_path, err, "", p_cache_mode == CACHE_MODE_IGNORE);
|
|
|
|
|
|
- if (scr.is_null()) {
|
|
|
- // Don't fail loading because of parsing error.
|
|
|
- scr.instantiate();
|
|
|
- }
|
|
|
-
|
|
|
if (r_error) {
|
|
|
- *r_error = OK;
|
|
|
+ // Don't fail loading because of parsing error.
|
|
|
+ *r_error = scr.is_valid() ? OK : err;
|
|
|
}
|
|
|
|
|
|
return scr;
|