mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +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
695765fde7
commit
2462e8dc9d
@ -890,12 +890,11 @@ DEF_CONSOLE_CMD(ConStartAI)
|
|||||||
|
|
||||||
AIConfig *config = AIConfig::GetConfig((CompanyID)n);
|
AIConfig *config = AIConfig::GetConfig((CompanyID)n);
|
||||||
if (argc >= 2) {
|
if (argc >= 2) {
|
||||||
class AIInfo *info = AI::GetCompanyInfo(argv[1]);
|
config->ChangeAI(argv[1]);
|
||||||
if (info == NULL) {
|
if (!config->HasAI()) {
|
||||||
IConsoleWarning("Failed to load the specified AI");
|
IConsoleWarning("Failed to load the specified AI");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
config->ChangeAI(argv[1]);
|
|
||||||
if (argc == 3) {
|
if (argc == 3) {
|
||||||
config->StringToSettings(argv[2]);
|
config->StringToSettings(argv[2]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user