From 43a2599801be348dfd41d928c7a66a590dbe8745 Mon Sep 17 00:00:00 2001 From: volzhs Date: Mon, 30 Jan 2017 04:27:14 +0900 Subject: [PATCH] Fix crash when saving root node by "Save Branch as Scene" with unsaved scene Fix #7667 --- tools/editor/scene_tree_dock.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp index aa6c8bc6e93..bd1d02a9e52 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/tools/editor/scene_tree_dock.cpp @@ -646,6 +646,13 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { Node *tocopy = selection.front()->get(); + if (tocopy==scene){ + accept->get_ok()->set_text(TTR("I see..")); + accept->set_text(TTR("Can not perform with the root node.")); + accept->popup_centered_minsize(); + break; + } + if (tocopy!=editor_data->get_edited_scene_root() && tocopy->get_filename()!="") { accept->get_ok()->set_text(TTR("I see..")); accept->set_text(TTR("This operation can't be done on instanced scenes."));