mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-31 02:19:09 +00:00
(svn r15051) -Fix: Only allow creation or deletion of an AI when in a game.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user