summaryrefslogtreecommitdiff
path: root/src/settings.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-01-21 23:19:50 +0000
committerrubidium <rubidium@openttd.org>2010-01-21 23:19:50 +0000
commit7ec3d9a0c66f82822fad924de7ab72a02e0521eb (patch)
tree3d4499134914de1040e06d0d83f9898f6287a1e1 /src/settings.cpp
parent18446dd5993b36d7ad5a2ca74935ce25bf816626 (diff)
downloadopenttd-7ec3d9a0c66f82822fad924de7ab72a02e0521eb.tar.xz
(svn r18883) -Codechange: warn in the difficulty and AI configuration window when setting the number of AIs to non-zero when you don't have AIs
Diffstat (limited to 'src/settings.cpp')
-rw-r--r--src/settings.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index 8a091816f..a136c3d75 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -58,6 +58,7 @@
#include "settings_func.h"
#include "ini_type.h"
#include "ai/ai_config.hpp"
+#include "ai/ai.hpp"
#include "newgrf.h"
#include "ship.h"
#include "company_base.h"
@@ -851,6 +852,11 @@ 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 &&
+ AI::GetInfoList()->size() == 0 && (!_networking || _network_server)) {
+ ShowErrorMessage(STR_WARNING_NO_SUITABLE_AI, INVALID_STRING_ID, 0, 0, true);
+ }
+
/* 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 */