From 6a4ba84320ae137793760b628dad23de29d0b633 Mon Sep 17 00:00:00 2001 From: truelight Date: Tue, 22 Nov 2005 15:55:38 +0000 Subject: (svn r3226) -Fix: GPMI implementation had minor glitches -Fix: the AI speed control is done by the AI-core, individual AIs don't have to do it (so, AIs were delayed twice ;) -Add: Support for AI-network-clients (an AI, connecting to a remote server) -Fix: minor AI-core problems --- openttd.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'openttd.c') diff --git a/openttd.c b/openttd.c index cc4732df7..e26bb7e0f 100644 --- a/openttd.c +++ b/openttd.c @@ -330,9 +330,9 @@ int ttd_main(int argc, char* argv[]) // a ':' behind it means: it need a param (e.g.: -m) // a '::' behind it means: it can optional have a param (e.g.: -d) #if !defined(__MORPHOS__) && !defined(__AMIGA__) && !defined(WIN32) - optformat = "m:s:v:hDfn::l:eit:d::r:g::G:p:c:"; + optformat = "bm:s:v:hDfn::l:eit:d::r:g::G:p:c:"; #else - optformat = "m:s:v:hDn::l:eit:d::r:g::G:p:c:"; // no fork option + optformat = "bm:s:v:hDn::l:eit:d::r:g::G:p:c:"; // no fork option #endif MyGetOptInit(&mgo, argc-1, argv+1, optformat); @@ -358,6 +358,7 @@ int ttd_main(int argc, char* argv[]) else network_conn = NULL; } break; + case 'b': _ai.network_client = true; break; case 'r': ParseResolution(resolution, mgo.opt); break; case 'l': language = mgo.opt; break; case 't': startdate = atoi(mgo.opt); break; @@ -395,12 +396,17 @@ int ttd_main(int argc, char* argv[]) } } + if (_ai.network_client && !network) { + _ai.network_client = false; + DEBUG(ai, 0)("[AI] Can't enable network-AI, because '-n' is not used\n"); + } + DeterminePaths(); CheckExternalFiles(); #ifdef GPMI /* Set the debug proc */ - gpmi_debug_proc = &gpmi_debug_openttd; + gpmi_debug_proc = &gpmi_debug_openttd; /* Initialize GPMI */ gpmi_init(); @@ -531,6 +537,11 @@ int ttd_main(int argc, char* argv[]) /* stop the AI */ AI_Uninitialize(); +#ifdef GPMI + /* Uninitialize GPMI */ + gpmi_uninit(); +#endif /* GPMI */ + /* Close all and any open filehandles */ FioCloseAll(); UnInitializeGame(); -- cgit v1.2.3-70-g09d2