summaryrefslogtreecommitdiff
path: root/openttd.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-11-22 15:55:38 +0000
committertruelight <truelight@openttd.org>2005-11-22 15:55:38 +0000
commit6a4ba84320ae137793760b628dad23de29d0b633 (patch)
tree6702beccddba7217fe3ad311ffda9285b6719e5d /openttd.c
parent4d2c4c5d8a9c260e4087fab654f61140e984f79c (diff)
downloadopenttd-6a4ba84320ae137793760b628dad23de29d0b633.tar.xz
(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
Diffstat (limited to 'openttd.c')
-rw-r--r--openttd.c17
1 files changed, 14 insertions, 3 deletions
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<driver>)
// a '::' behind it means: it can optional have a param (e.g.: -d<debug>)
#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();