summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2009-01-13 11:06:21 +0000
committerpeter1138 <peter1138@openttd.org>2009-01-13 11:06:21 +0000
commitf0e6eeb57d13d70e220a2886564bb4ce95afe52a (patch)
treeeb3d697deb6f1caee53425dfbec40d0cb4aa3f23 /src
parent56b91b582e773b43687748ea750692ccb292f946 (diff)
downloadopenttd-f0e6eeb57d13d70e220a2886564bb4ce95afe52a.tar.xz
(svn r15051) -Fix: Only allow creation or deletion of an AI when in a game.
Diffstat (limited to 'src')
-rw-r--r--src/console_cmds.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp
index 3f23b7c71..8b9f962b3 100644
--- a/src/console_cmds.cpp
+++ b/src/console_cmds.cpp
@@ -862,6 +862,11 @@ DEF_CONSOLE_CMD(ConStartAI)
return true;
}
+ if (_game_mode != GM_NORMAL) {
+ IConsoleWarning("AIs can only be managed in a game.");
+ return true;
+ }
+
if (ActiveCompanyCount() == MAX_COMPANIES) {
IConsoleWarning("Can't start a new AI (no more free slots).");
return true;
@@ -916,6 +921,11 @@ DEF_CONSOLE_CMD(ConStopAI)
return true;
}
+ if (_game_mode != GM_NORMAL) {
+ IConsoleWarning("AIs can only be managed in a game.");
+ return true;
+ }
+
if (_networking && !_network_server) {
IConsoleWarning("Only the server can stop an AI.");
return true;