TileSet Export: Avoid invalid error when merge is enabled but file does not exist

(cherry picked from commit 897b33ce77)
This commit is contained in:
Ignacio Etcheverry 2016-03-11 01:20:01 +01:00 committed by Rémi Verschelde
parent 6ce273b329
commit d950a13c10
1 changed files with 11 additions and 14 deletions

View File

@ -1266,23 +1266,20 @@ void EditorNode::_dialog_action(String p_file) {
if (FileAccess::exists(p_file)) { if (FileAccess::exists(p_file)) {
ml=ResourceLoader::load(p_file,"TileSet"); 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(); ml->clear();
} }
} } else {
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;
}
ml = Ref<TileSet>( memnew( TileSet )); ml = Ref<TileSet>( memnew( TileSet ));
} }