diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-28 16:53:46 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-28 16:53:46 +0100 |
commit | 55dae301777ba609c3255026f9a9852a0dbfd43b (patch) | |
tree | 79ffaa6e686043bff3580bd00eaa99292673bc50 | |
parent | 4555ccdf98b53cef43e3c6dc17e8779f6a13431b (diff) | |
parent | 076590886888d544047d9fa3918f8c8959b17e8d (diff) |
Merge pull request #69301 from KoBeWi/ERR_WHATEVER
Don't break parsing on missing resources
-rw-r--r-- | core/variant/variant_parser.cpp | 2 | ||||
-rw-r--r-- | scene/resources/resource_format_text.cpp | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/core/variant/variant_parser.cpp b/core/variant/variant_parser.cpp index d2e4d752a4..17d41ca95e 100644 --- a/core/variant/variant_parser.cpp +++ b/core/variant/variant_parser.cpp @@ -1283,7 +1283,7 @@ Error VariantParser::_parse_dictionary(Dictionary &object, Stream *p_stream, int Variant v; err = parse_value(token, v, p_stream, line, r_err_str, p_res_parser); - if (err) { + if (err && err != ERR_FILE_MISSING_DEPENDENCIES) { return err; } object[key] = v; diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 8b2b7e118c..354373ef3c 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -144,6 +144,7 @@ Error ResourceLoaderText::_parse_ext_resource(VariantParser::Stream *p_stream, R } String id = token.value; + Error err = OK; if (!ignore_resource_parsing) { if (!ext_resources.has(id)) { @@ -163,7 +164,7 @@ Error ResourceLoaderText::_parse_ext_resource(VariantParser::Stream *p_stream, R error = ERR_FILE_MISSING_DEPENDENCIES; error_text = "[ext_resource] referenced nonexistent resource at: " + path; _printerr(); - return error; + err = error; } else { ResourceLoader::notify_dependency_error(local_path, path, type); } @@ -175,7 +176,7 @@ Error ResourceLoaderText::_parse_ext_resource(VariantParser::Stream *p_stream, R error = ERR_FILE_MISSING_DEPENDENCIES; error_text = "[ext_resource] referenced non-loaded resource at: " + path; _printerr(); - return error; + err = error; } } else { r_res = Ref<Resource>(); @@ -187,7 +188,7 @@ Error ResourceLoaderText::_parse_ext_resource(VariantParser::Stream *p_stream, R return ERR_PARSE_ERROR; } - return OK; + return err; } Ref<PackedScene> ResourceLoaderText::_parse_node_tag(VariantParser::ResourceParser &parser) { |