From d25bae855981c08b5bbb6a8930d80a9d3b04a58c Mon Sep 17 00:00:00 2001 From: cow-neaz Date: Fri, 17 Jun 2022 03:20:37 +0300 Subject: [PATCH] Stop game on reloading project (cherry picked from commit 8935cf17cf674b0cb027e5c82a21a64d3a43feb1) --- editor/editor_node.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 3d1ef907d..ebf5b38f9 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1607,6 +1607,10 @@ void EditorNode::save_scene_list(Vector p_scene_filenames) { void EditorNode::restart_editor() { exiting = true; + if (editor_run.get_status() != EditorRun::STATUS_STOP) { + editor_run.stop(); + } + String to_reopen; if (get_tree()->get_edited_scene_root()) { to_reopen = get_tree()->get_edited_scene_root()->get_filename();