3 | --- console_cmds.cpp (revision 27582)
| 3 | --- script_config.cpp (revision 27582)
|
---|
4 | +++ console_cmds.cpp (working copy)
| 4 | +++ script_config.cpp (working copy)
|
---|
5 | @@ -34,6 +34,7 @@
| 5 | @@ -23,6 +23,7 @@
|
---|
6 | #include "gamelog.h"
| 6 | free(this->name);
|
---|
7 | #include "ai/ai.hpp"
| 7 | this->name = (name == NULL) ? NULL : stredup(name);
|
---|
8 | #include "ai/ai_config.hpp"
| 8 | this->info = (name == NULL) ? NULL : this->FindInfo(this->name, version, force_exact_match);
|
---|
9 | +#include "ai/ai_info.hpp"
| 9 | + if (this->info != NULL) this->name = (GetInfo()->GetName());
|
---|
10 | #include "newgrf.h"
| 10 | this->version = (info == NULL) ? -1 : info->GetVersion();
|
---|
11 | #include "console_func.h"
| 11 | this->is_random = is_random;
|
---|
12 | #include "engine_base.h"
| 12 | if (this->config_list != NULL) delete this->config_list; |
---|
13 | @@ -1171,6 +1172,9 @@
| | |
---|
14 | if (!config->HasScript()) {
| | |
---|
15 | IConsoleWarning("Failed to load the specified AI");
| | |
---|
16 | return true;
| | |
---|
17 | + } else {
| | |
---|
18 | + AIInfo *info = config->GetInfo();
| | |
---|
19 | + config->Change(info->GetName());
| | |
---|
20 | }
| | |
---|
21 | if (argc == 3) {
| | |
---|
22 | config->StringToSettings(argv[2]); | | |
---|