diff options
author | Yexo <Yexo@openttd.org> | 2009-01-23 21:52:29 +0000 |
---|---|---|
committer | Yexo <Yexo@openttd.org> | 2009-01-23 21:52:29 +0000 |
commit | 2ce1c074b9bb7ceef6f515f9fd7a4a6cf2848665 (patch) | |
tree | 674bac2dc7a8d2245a567f7cc1ab03e437287f75 /src/settings.cpp | |
parent | 4812e633a23e746e2af013b54e749a3060bedd00 (diff) | |
download | openttd-2ce1c074b9bb7ceef6f515f9fd7a4a6cf2848665.tar.xz |
(svn r15239) -Fix [FS#2579]: The start date of random AIs was not stored in the config file or the savegame.
Diffstat (limited to 'src/settings.cpp')
-rw-r--r-- | src/settings.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index 02497e1f4..a4d3fb516 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1716,8 +1716,10 @@ static void AILoadConfig(IniFile *ini, const char *grpname) config->ChangeAI(item->name); if (!config->HasAI()) { - if (strcmp(item->name, "none") != 0) DEBUG(ai, 0, "The AI by the name '%s' was no longer found, and removed from the list.", item->name); - continue; + if (strcmp(item->name, "none") != 0) { + DEBUG(ai, 0, "The AI by the name '%s' was no longer found, and removed from the list.", item->name); + continue; + } } config->StringToSettings(item->value); } @@ -1801,12 +1803,11 @@ static void AISaveConfig(IniFile *ini, const char *grpname) AIConfig *config = AIConfig::GetConfig(c, true); const char *name; char value[1024]; + config->SettingsToString(value, lengthof(value)); if (config->HasAI()) { - config->SettingsToString(value, lengthof(value)); name = config->GetName(); } else { - value[0] = '\0'; name = "none"; } |