Merge pull request #7678 from volzhs/fix-save-branch

Fix crash when saving root node by "Save Branch as Scene" with unsaved scene
This commit is contained in:
Rémi Verschelde 2017-02-02 08:15:28 +01:00 committed by GitHub
commit 34b6caa433
1 changed files with 7 additions and 0 deletions

View File

@ -646,6 +646,13 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
Node *tocopy = selection.front()->get(); 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()!="") { if (tocopy!=editor_data->get_edited_scene_root() && tocopy->get_filename()!="") {
accept->get_ok()->set_text(TTR("I see..")); accept->get_ok()->set_text(TTR("I see.."));
accept->set_text(TTR("This operation can't be done on instanced scenes.")); accept->set_text(TTR("This operation can't be done on instanced scenes."));