diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-02-28 15:42:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-28 15:42:09 +0100 |
commit | 54a777b523fecb773b1b598bc648d4e979dcefdf (patch) | |
tree | 673a1462eed15dbbdc6ac09893524f41deafb335 /scene/resources | |
parent | 345b4bb86ae9b3e5d3cee6078a7e452b7c933200 (diff) | |
parent | 678ec9bcde6c931bcb965b944582453229f4da2f (diff) |
Merge pull request #58554 from KoBeWi/MIA
Don't abort loading scene on missing dependency
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 c03faa2c2d..d9ac967699 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -153,7 +153,7 @@ Error ResourceLoaderText::_parse_ext_resource(VariantParser::Stream *p_stream, R RES res = ResourceLoader::load_threaded_get(path); if (res.is_null()) { if (ResourceLoader::get_abort_on_missing_resources()) { - error = ERR_FILE_CORRUPT; + error = ERR_FILE_MISSING_DEPENDENCIES; error_text = "[ext_resource] referenced nonexistent resource at: " + path; _printerr(); return error; @@ -165,7 +165,7 @@ Error ResourceLoaderText::_parse_ext_resource(VariantParser::Stream *p_stream, R r_res = res; } } else { - error = ERR_FILE_CORRUPT; + error = ERR_FILE_MISSING_DEPENDENCIES; error_text = "[ext_resource] referenced non-loaded resource at: " + path; _printerr(); return error; @@ -265,7 +265,9 @@ Ref<PackedScene> ResourceLoaderText::_parse_node_tag(VariantParser::ResourcePars error = VariantParser::parse_tag_assign_eof(&stream, lines, error_text, next_tag, assign, value, &parser); if (error) { - if (error != ERR_FILE_EOF) { + if (error == ERR_FILE_MISSING_DEPENDENCIES) { + // Resource loading error, just skip it. + } else if (error != ERR_FILE_EOF) { _printerr(); return Ref<PackedScene>(); } else { |