浏览代码

Merge pull request #32352 from neikeq/issue-32237

Mono: Don't use project settings for debugger agent on exported games
Rémi Verschelde 6 年之前
父节点
当前提交
0a10e07124
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7 4
      modules/mono/mono_gd/gd_mono.cpp

+ 7 - 4
modules/mono/mono_gd/gd_mono.cpp

@@ -119,26 +119,29 @@ void gdmono_debug_init() {
 
 
 	mono_debug_init(MONO_DEBUG_FORMAT_MONO);
 	mono_debug_init(MONO_DEBUG_FORMAT_MONO);
 
 
+	CharString da_args = OS::get_singleton()->get_environment("GODOT_MONO_DEBUGGER_AGENT").utf8();
+
+#ifdef TOOLS_ENABLED
 	int da_port = GLOBAL_DEF("mono/debugger_agent/port", 23685);
 	int da_port = GLOBAL_DEF("mono/debugger_agent/port", 23685);
 	bool da_suspend = GLOBAL_DEF("mono/debugger_agent/wait_for_debugger", false);
 	bool da_suspend = GLOBAL_DEF("mono/debugger_agent/wait_for_debugger", false);
 	int da_timeout = GLOBAL_DEF("mono/debugger_agent/wait_timeout", 3000);
 	int da_timeout = GLOBAL_DEF("mono/debugger_agent/wait_timeout", 3000);
 
 
-	CharString da_args = OS::get_singleton()->get_environment("GODOT_MONO_DEBUGGER_AGENT").utf8();
-
-#ifdef TOOLS_ENABLED
 	if (Engine::get_singleton()->is_editor_hint() ||
 	if (Engine::get_singleton()->is_editor_hint() ||
 			ProjectSettings::get_singleton()->get_resource_path().empty() ||
 			ProjectSettings::get_singleton()->get_resource_path().empty() ||
 			Main::is_project_manager()) {
 			Main::is_project_manager()) {
 		if (da_args.size() == 0)
 		if (da_args.size() == 0)
 			return;
 			return;
 	}
 	}
-#endif
 
 
 	if (da_args.length() == 0) {
 	if (da_args.length() == 0) {
 		da_args = String("--debugger-agent=transport=dt_socket,address=127.0.0.1:" + itos(da_port) +
 		da_args = String("--debugger-agent=transport=dt_socket,address=127.0.0.1:" + itos(da_port) +
 						 ",embedding=1,server=y,suspend=" + (da_suspend ? "y,timeout=" + itos(da_timeout) : "n"))
 						 ",embedding=1,server=y,suspend=" + (da_suspend ? "y,timeout=" + itos(da_timeout) : "n"))
 						  .utf8();
 						  .utf8();
 	}
 	}
+#else
+	if (da_args.length() == 0)
+		return; // Exported games don't use the project settings to setup the debugger agent
+#endif
 
 
 	// --debugger-agent=help
 	// --debugger-agent=help
 	const char *options[] = {
 	const char *options[] = {