# HG changeset patch # User truebrain # Date 1231805318 0 # Node ID 185f0238d14c7b3e6872e956cd78001326c7f247 # Parent 72ab9b498760d9bcec9edb92e805d19ea02c1a2d (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) diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -890,12 +890,11 @@ 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]); }