Browse Source

Stop game on reloading project

cow-neaz 3 years ago
parent
commit
8935cf17cf
1 changed files with 4 additions and 0 deletions
  1. 4 0
      editor/editor_node.cpp

+ 4 - 0
editor/editor_node.cpp

@@ -1792,6 +1792,10 @@ void EditorNode::save_scene_list(Vector<String> 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_scene_file_path();