|
|
@ -1202,7 +1202,7 @@ static void AILoadConfig(IniFile *ini, const char *grpname)
|
|
|
|
|
|
|
|
|
|
|
|
/* Clean any configured AI */
|
|
|
|
/* Clean any configured AI */
|
|
|
|
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
|
|
|
|
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
|
|
|
|
AIConfig::GetConfig(c, true)->ChangeAI(NULL);
|
|
|
|
AIConfig::GetConfig(c, AIConfig::AISS_FORCE_NEWGAME)->ChangeAI(NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* If no group exists, return */
|
|
|
|
/* If no group exists, return */
|
|
|
@ -1210,7 +1210,7 @@ static void AILoadConfig(IniFile *ini, const char *grpname)
|
|
|
|
|
|
|
|
|
|
|
|
CompanyID c = COMPANY_FIRST;
|
|
|
|
CompanyID c = COMPANY_FIRST;
|
|
|
|
for (item = group->item; c < MAX_COMPANIES && item != NULL; c++, item = item->next) {
|
|
|
|
for (item = group->item; c < MAX_COMPANIES && item != NULL; c++, item = item->next) {
|
|
|
|
AIConfig *config = AIConfig::GetConfig(c, true);
|
|
|
|
AIConfig *config = AIConfig::GetConfig(c, AIConfig::AISS_FORCE_NEWGAME);
|
|
|
|
|
|
|
|
|
|
|
|
config->ChangeAI(item->name);
|
|
|
|
config->ChangeAI(item->name);
|
|
|
|
if (!config->HasAI()) {
|
|
|
|
if (!config->HasAI()) {
|
|
|
@ -1313,7 +1313,7 @@ static void AISaveConfig(IniFile *ini, const char *grpname)
|
|
|
|
group->Clear();
|
|
|
|
group->Clear();
|
|
|
|
|
|
|
|
|
|
|
|
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
|
|
|
|
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
|
|
|
|
AIConfig *config = AIConfig::GetConfig(c, true);
|
|
|
|
AIConfig *config = AIConfig::GetConfig(c, AIConfig::AISS_FORCE_NEWGAME);
|
|
|
|
const char *name;
|
|
|
|
const char *name;
|
|
|
|
char value[1024];
|
|
|
|
char value[1024];
|
|
|
|
config->SettingsToString(value, lengthof(value));
|
|
|
|
config->SettingsToString(value, lengthof(value));
|
|
|
|