summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2016-03-11 01:20:01 +0100
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2016-03-11 01:20:01 +0100
commit897b33ce77dee4ba22ce30aede7784eec73f9c64 (patch)
treead3ac75d4558ac908d731d83dd40e91ff397db8c
parentd9ef89f90a24aa3f0557bc13fd2a175014c491c0 (diff)
TileSet Export: Avoid invalid error when merge is enabled but file does not exist
-rw-r--r--tools/editor/editor_node.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 24df4544ec..c36d285e78 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -1267,23 +1267,20 @@ void EditorNode::_dialog_action(String p_file) {
if (FileAccess::exists(p_file)) {
ml=ResourceLoader::load(p_file,"TileSet");
- if (!file_export_lib_merge->is_pressed()) {
+ if (ml.is_null()) {
+ if (file_export_lib_merge->is_pressed()) {
+ current_option=-1;
+ //accept->get_cancel()->hide();
+ accept->get_ok()->set_text("I see..");
+ accept->set_text("Can't load TileSet for merging!.");
+ accept->popup_centered_minsize();
+ return;
+ }
+ } else if (!file_export_lib_merge->is_pressed()) {
ml->clear();
}
- }
-
- if (ml.is_null()) {
-
- if (file_export_lib_merge->is_pressed()) {
- current_option=-1;
- //accept->get_cancel()->hide();
- accept->get_ok()->set_text("I see..");
- accept->set_text("Can't load TileSet for merging!.");
- accept->popup_centered_minsize();
- return;
- }
-
+ } else {
ml = Ref<TileSet>( memnew( TileSet ));
}