Skip to content

Commit

Permalink
Merge pull request #58554 from KoBeWi/MIA
Browse files Browse the repository at this point in the history
Don't abort loading scene on missing dependency
  • Loading branch information
akien-mga authored Feb 28, 2022
2 parents 345b4bb + 678ec9b commit 54a777b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scene/resources/resource_format_text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 54a777b

Please sign in to comment.