Merge branch 'master' into jgrpp

# Conflicts:
#	src/fileio.cpp
#	src/group_gui.cpp
#	src/industry.h
#	src/lang/korean.txt
#	src/linkgraph/linkgraphjob.cpp
#	src/linkgraph/linkgraphjob.h
#	src/linkgraph/linkgraphschedule.cpp
#	src/linkgraph/linkgraphschedule.h
#	src/openttd.cpp
#	src/saveload/saveload.cpp
#	src/saveload/saveload.h
#	src/town_cmd.cpp
#	src/vehicle_gui.cpp
#	src/vehicle_gui_base.h
This commit is contained in:
Jonathan G Rennison
2021-01-30 18:27:25 +00:00
102 changed files with 1870 additions and 1765 deletions

View File

@@ -1241,7 +1241,24 @@ DEF_CONSOLE_CMD(ConStartAI)
AIConfig *config = AIConfig::GetConfig((CompanyID)n);
if (argc >= 2) {
config->Change(argv[1], -1, true);
config->Change(argv[1], -1, false);
/* If the name is not found, and there is a dot in the name,
* try again with the assumption everything right of the dot is
* the version the user wants to load. */
if (!config->HasScript()) {
char *name = stredup(argv[1]);
char *e = strrchr(name, '.');
if (e != nullptr) {
*e = '\0';
e++;
int version = atoi(e);
config->Change(name, version, true);
}
free(name);
}
if (!config->HasScript()) {
IConsoleWarning("Failed to load the specified AI");
return true;