From 97e30f4cd70b7d89e56e8dbe84e936d2ffabb667 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Mon, 2 May 2016 13:40:44 +0200 Subject: [PATCH] Fix checking unsaved changes only in current scene (cherry picked from commit 107e62be7045ae69415f8069a6f49ec912ec3799) --- tools/editor/editor_node.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 0424175ee04..11726512b37 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -4515,7 +4515,11 @@ void EditorNode::_scene_tab_script_edited(int p_tab) { void EditorNode::_scene_tab_closed(int p_tab) { current_option = SCENE_TAB_CLOSE; tab_closing = p_tab; - if (unsaved_cache) { + + bool unsaved = (p_tab==editor_data.get_edited_scene()) ? + saved_version!=editor_data.get_undo_redo().get_version() : + editor_data.get_scene_version(p_tab)!=0; + if (unsaved) { confirmation->get_ok()->set_text("Yes"); //confirmation->get_cancel()->show(); confirmation->set_text("Close scene? (Unsaved changes will be lost)");