(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 c8f9cbca53
commit a2b24a8362

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