diff options
author | yexo <yexo@openttd.org> | 2010-03-12 01:37:41 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-03-12 01:37:41 +0000 |
commit | f206958010d62e321b3d8f27816470f0e8c23896 (patch) | |
tree | 37e49d41f2f7f81c2fa4ab6eee33ea1063bf2f9a /src/settings.cpp | |
parent | e3fb793a8a6d4bab58e68c54736a655e2373b78c (diff) | |
download | openttd-f206958010d62e321b3d8f27816470f0e8c23896.tar.xz |
(svn r19389) -Fix [FS3676]: only show the "No AIs available" error message when explicitly changing the number of AI opponents
Diffstat (limited to 'src/settings.cpp')
-rw-r--r-- | src/settings.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index 9826d0c3a..46da600aa 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -905,14 +905,6 @@ static bool DifficultyChange(int32) _settings_game.difficulty.diff_level = 3; } - if (((_game_mode == GM_MENU) ? _settings_newgame.difficulty : _settings_game.difficulty).max_no_competitors != 0 && -#ifdef ENABLE_AI - AI::GetInfoList()->size() == 0 && -#endif /* ENABLE_AI */ - (!_networking || _network_server)) { - ShowErrorMessage(STR_WARNING_NO_SUITABLE_AI, INVALID_STRING_ID, WL_CRITICAL); - } - /* If we are a network-client, update the difficult setting (if it is open). * Use this instead of just dirtying the window because we need to load in * the new difficulty settings */ @@ -935,6 +927,19 @@ static bool DifficultyNoiseChange(int32 i) return DifficultyChange(i); } +static bool MaxNoAIsChange(int32 i) +{ + if (((_game_mode == GM_MENU) ? _settings_newgame.difficulty : _settings_game.difficulty).max_no_competitors != 0 && +#ifdef ENABLE_AI + AI::GetInfoList()->size() == 0 && +#endif /* ENABLE_AI */ + (!_networking || _network_server)) { + ShowErrorMessage(STR_WARNING_NO_SUITABLE_AI, INVALID_STRING_ID, WL_CRITICAL); + } + + return DifficultyChange(i); +} + /** * Check whether the road side may be changed. * @param p1 unused |