Pārlūkot izejas kodu

Fix run project when current scene was never saved

(cherry picked from commit 9c84e34fd444e0101a4169cadae46c1d28f6dc5f)
Tomasz Chabora 5 gadi atpakaļ
vecāks
revīzija
2bcb9d2a04
1 mainītis faili ar 2 papildinājumiem un 10 dzēšanām
  1. 2 10
      editor/editor_node.cpp

+ 2 - 10
editor/editor_node.cpp

@@ -2086,8 +2086,7 @@ void EditorNode::_run(bool p_current, const String &p_custom) {
 	String args;
 	bool skip_breakpoints;
 
-	if (p_current || (editor_data.get_edited_scene_root() && p_custom == editor_data.get_edited_scene_root()->get_filename())) {
-
+	if (p_current || (editor_data.get_edited_scene_root() && p_custom != String() && p_custom == editor_data.get_edited_scene_root()->get_filename())) {
 		Node *scene = editor_data.get_edited_scene_root();
 
 		if (!scene) {
@@ -2120,14 +2119,7 @@ void EditorNode::_run(bool p_current, const String &p_custom) {
 
 			Node *scene = editor_data.get_edited_scene_root();
 
-			if (scene) { //only autosave if there is a scene obviously
-
-				if (scene->get_filename() == "") {
-
-					show_accept(TTR("Current scene was never saved, please save it prior to running."), TTR("OK"));
-					return;
-				}
-
+			if (scene && scene->get_filename() != "") { // Only autosave if there is a scene and if it has a path.
 				_save_scene_with_preview(scene->get_filename());
 			}
 		}