summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/console_cmds.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp
index 19352684e..3f23b7c71 100644
--- a/src/console_cmds.cpp
+++ b/src/console_cmds.cpp
@@ -890,12 +890,11 @@ DEF_CONSOLE_CMD(ConStartAI)
AIConfig *config = AIConfig::GetConfig((CompanyID)n);
if (argc >= 2) {
- class AIInfo *info = AI::GetCompanyInfo(argv[1]);
- if (info == NULL) {
+ config->ChangeAI(argv[1]);
+ if (!config->HasAI()) {
IConsoleWarning("Failed to load the specified AI");
return true;
}
- config->ChangeAI(argv[1]);
if (argc == 3) {
config->StringToSettings(argv[2]);
}