diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-05-08 15:48:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-08 15:48:23 +0200 |
commit | b0d73d3099b5c4879224fd6b3786d62299e1a288 (patch) | |
tree | 59d488b9e77f61dbe081cf08aad3c0dbfdd47453 /editor/editor_node.cpp | |
parent | 869124e343e5036b45082bf514011c264b8c5171 (diff) | |
parent | 19b8c51e1dfacd93d58fb3fdf227289cb832507e (diff) |
Merge pull request #28754 from YeldhamDev/inherent_scene_close_empty_changes
Change empty scene closing on new inherented scene to a better approach
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r-- | editor/editor_node.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 8703076a57..23d1f25641 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1271,6 +1271,11 @@ void EditorNode::_dialog_action(String p_file) { switch (current_option) { case FILE_NEW_INHERITED_SCENE: { + Node *scene = editor_data.get_edited_scene_root(); + // If the previous scene is rootless, just close it in favor of the new one. + if (!scene) + _menu_option_confirm(FILE_CLOSE, false); + load_scene(p_file, false, true); } break; case FILE_OPEN_SCENE: { |