diff options
author | truebrain <truebrain@openttd.org> | 2009-01-13 00:08:38 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2009-01-13 00:08:38 +0000 |
commit | 2462e8dc9d7e3a5a76c96d3c0229019a48e9bfdd (patch) | |
tree | 4bda69fe090f594da5db5f68bc1faa76c77adef4 | |
parent | 695765fde79e9b30670d11cf65b74224816cb509 (diff) | |
download | openttd-2462e8dc9d7e3a5a76c96d3c0229019a48e9bfdd.tar.xz |
(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)
-rw-r--r-- | src/console_cmds.cpp | 5 |
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]); } |