summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-03-19 22:37:41 +0000
committeryexo <yexo@openttd.org>2009-03-19 22:37:41 +0000
commit5933a07a8622baac6f9372820b5e854d9d072f05 (patch)
treec22ef40f3c83b36e76809588643f8e0db09c187c /src
parentd405795bf1b63bde0a4806c71063ebc83a4c3a77 (diff)
downloadopenttd-5933a07a8622baac6f9372820b5e854d9d072f05.tar.xz
(svn r15771) -Fix (r13256): Settings from the [gameopt] section (from 0.6 config files) were overwritten with default values.
Diffstat (limited to 'src')
-rw-r--r--src/settings.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index 2711ea330..629e3901c 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -1280,7 +1280,7 @@ static const SettingDesc _gameopt_settings[] = {
* 'SLE_FILE_I16 | SLE_VAR_U16' in "diff_custom" is needed to get around SlArray() hack
* for savegames version 0 - though it is an array, it has to go through the byteswap process */
SDTG_GENERAL("diff_custom", SDT_INTLIST, SL_ARR, SLE_FILE_I16 | SLE_VAR_U16, C, 0, _old_diff_custom, 17, 0, 0, 0, 0, NULL, STR_NULL, NULL, 0, 3),
- SDTG_GENERAL("diff_custom", SDT_INTLIST, SL_ARR, SLE_UINT16, C, 0, _old_diff_custom, 18, 0, 0, 0, 0, NULL, STR_NULL, NULL, 4, 96),
+ SDTG_GENERAL("diff_custom", SDT_INTLIST, SL_ARR, SLE_UINT16, C, 0, _old_diff_custom, 18, 0, 0, 0, 0, NULL, STR_NULL, NULL, 4, SL_MAX_VERSION),
SDT_VAR(GameSettings, difficulty.diff_level, SLE_UINT8, 0, 0, 0, 0, 3, 0, STR_NULL, NULL),
SDT_OMANY(GameSettings, locale.currency, SLE_UINT8, N, 0, 0, CUSTOM_CURRENCY_ID, "GBP|USD|EUR|YEN|ATS|BEF|CHF|CZK|DEM|DKK|ESP|FIM|FRF|GRD|HUF|ISK|ITL|NLG|NOK|PLN|ROL|RUR|SIT|SEK|YTL|SKK|BRL|EEK|custom", STR_NULL, NULL, NULL),
@@ -1908,15 +1908,16 @@ void LoadFromConfig()
IniFile *ini = IniLoadConfig();
ResetCurrencies(false); // Initialize the array of curencies, without preserving the custom one
- PrepareOldDiffCustom();
- ini_load_settings(ini, _gameopt_settings, "gameopt", &_settings_newgame);
- HandleOldDiffCustom(false);
-
HandleSettingDescs(ini, ini_load_settings, ini_load_setting_list);
_grfconfig_newgame = GRFLoadConfig(ini, "newgrf", false);
_grfconfig_static = GRFLoadConfig(ini, "newgrf-static", true);
NewsDisplayLoadConfig(ini, "news_display");
AILoadConfig(ini, "ai_players");
+
+ PrepareOldDiffCustom();
+ ini_load_settings(ini, _gameopt_settings, "gameopt", &_settings_newgame);
+ HandleOldDiffCustom(false);
+
CheckDifficultyLevels();
delete ini;
}