From c0e872c05b211e8f258785f33f03f43c17d62fa8 Mon Sep 17 00:00:00 2001 From: Saracen Date: Mon, 9 Oct 2023 03:15:46 +0100 Subject: [PATCH] Fix dependency menu not showing up if scene failed to load. --- editor/editor_node.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 8d350638a1f..5b003ffdc06 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3732,16 +3732,6 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b Error err; Ref sdata = ResourceLoader::load(lpath, "", ResourceFormatLoader::CACHE_MODE_REPLACE, &err); - if (!sdata.is_valid()) { - _dialog_display_load_error(lpath, err); - opening_prev = false; - - if (prev != -1) { - _set_current_scene(prev); - editor_data.remove_scene(idx); - } - return ERR_FILE_NOT_FOUND; - } if (!p_ignore_broken_deps && dependency_errors.has(lpath)) { current_menu_option = -1; @@ -3759,6 +3749,17 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b return ERR_FILE_MISSING_DEPENDENCIES; } + if (!sdata.is_valid()) { + _dialog_display_load_error(lpath, err); + opening_prev = false; + + if (prev != -1) { + _set_current_scene(prev); + editor_data.remove_scene(idx); + } + return ERR_FILE_NOT_FOUND; + } + dependency_errors.erase(lpath); // At least not self path. for (KeyValue> &E : dependency_errors) {