(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)

This commit is contained in:
truebrain 2009-01-13 00:08:38 +00:00
parent 695765fde7
commit 2462e8dc9d
1 changed files with 2 additions and 3 deletions

View File

@ -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]);
}