From c26fd4eaccce894575e7c3df3207feb54753fd82 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Tue, 13 Jan 2009 11:06:21 +0000 Subject: (svn r15051) -Fix: Only allow creation or deletion of an AI when in a game. --- src/console_cmds.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; -- cgit v1.2.3-70-g09d2