(svn r21694) -Fix: changing AI settings ingame was impossible when the difficulty level was other than custom

pull/155/head
yexo 14 years ago
parent b84a618575
commit 3436562d3a

@ -977,6 +977,9 @@ static void ValidateSettings()
static bool DifficultyReset(int32 level)
{
/* In game / in the scenario editor you can set the difficulty level only to custom. This is
* needed by the AI Gui code that sets the difficulty level when you change any AI settings. */
if (_game_mode != GM_MENU && level != 3) return false;
SetDifficultyLevel(level, (_game_mode == GM_MENU) ? &_settings_newgame.difficulty : &_settings_game.difficulty);
return true;
}

@ -362,7 +362,7 @@ const SettingDesc _settings[] = {
SDT_CONDVAR(GameSettings, difficulty.line_reverse_mode, SLE_UINT8, 97, SL_MAX_VERSION, 0, 0, 0, 0, 1, 1, STR_REVERSE_AT_END_OF_LINE_AND_AT_STATIONS,DifficultyChange),
SDT_CONDVAR(GameSettings, difficulty.disasters, SLE_UINT8, 97, SL_MAX_VERSION, 0, 0, 0, 0, 1, 1, STR_DISASTERS_OFF, DifficultyChange),
SDT_CONDVAR(GameSettings, difficulty.town_council_tolerance, SLE_UINT8, 97, SL_MAX_VERSION, 0, 0, 0, 0, 2, 1, STR_CITY_APPROVAL_PERMISSIVE, DifficultyNoiseChange),
SDT_CONDVAR(GameSettings, difficulty.diff_level, SLE_UINT8, 97, SL_MAX_VERSION, 0,NG, 3, 0, 3, 0, STR_NULL, DifficultyReset),
SDT_CONDVAR(GameSettings, difficulty.diff_level, SLE_UINT8, 97, SL_MAX_VERSION, 0, 0, 3, 0, 3, 0, STR_NULL, DifficultyReset),
/* There are only 21 predefined town_name values (0-20), but you can have more with newgrf action F so allow these bigger values (21-255). Invalid values will fallback to english on use and (undefined string) in GUI. */
SDT_CONDOMANY(GameSettings, game_creation.town_name, SLE_UINT8, 97, SL_MAX_VERSION, 0,NN, 0, 255, _town_names, STR_NULL, NULL, NULL),

Loading…
Cancel
Save