mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(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:
parent
c8f9cbca53
commit
a2b24a8362
@ -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]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user