浏览代码

Don't save project on startup in headless mode

kobewi 4 年之前
父节点
当前提交
ea2489ce93
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      editor/editor_node.cpp

+ 4 - 2
editor/editor_node.cpp

@@ -613,8 +613,10 @@ void EditorNode::_notification(int p_what) {
 				_editor_select(EDITOR_3D);
 			}
 
-			// Save the project after opening to mark it as last modified.
-			ProjectSettings::get_singleton()->save();
+			// Save the project after opening to mark it as last modified, except in headless mode.
+			if (DisplayServer::get_singleton()->window_can_draw()) {
+				ProjectSettings::get_singleton()->save();
+			}
 
 			/* DO NOT LOAD SCENES HERE, WAIT FOR FILE SCANNING AND REIMPORT TO COMPLETE */
 		} break;