From 2462e8dc9d7e3a5a76c96d3c0229019a48e9bfdd Mon Sep 17 00:00:00 2001 From: truebrain Date: Tue, 13 Jan 2009 00:08:38 +0000 Subject: (svn r15043) -Fix: just try to change the AI, and see if that succeeded, instead of hoping you understand the internals of a change AI routine (to avoid possible mistakes in the future) --- src/console_cmds.cpp | 5 ++--- 1 file 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]); } -- cgit v1.2.3-70-g09d2