diff options
author | yexo <yexo@openttd.org> | 2010-03-15 22:42:43 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-03-15 22:42:43 +0000 |
commit | e3591f8a1d0b0e5a84cc8b9d45bb5809a622d1f2 (patch) | |
tree | 93ba6a93348ba5abc5fa64a3ef933a5319f27349 /src/ai/ai_config.cpp | |
parent | 30189ff459d08142baa9fac9f67dd6246faeae27 (diff) | |
download | openttd-e3591f8a1d0b0e5a84cc8b9d45bb5809a622d1f2.tar.xz |
(svn r19429) -Fix: when the title game contains an AIPL block the AI settinsg where overwritten by those from the title game
Diffstat (limited to 'src/ai/ai_config.cpp')
-rw-r--r-- | src/ai/ai_config.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ai/ai_config.cpp b/src/ai/ai_config.cpp index c0ae01848..aab8b1f18 100644 --- a/src/ai/ai_config.cpp +++ b/src/ai/ai_config.cpp @@ -93,13 +93,13 @@ const AIConfigItemList *AIConfig::GetConfigList() return this->config_list; } -AIConfig *AIConfig::GetConfig(CompanyID company, bool forceNewgameSetting) +AIConfig *AIConfig::GetConfig(CompanyID company, AISettingSource source) { AIConfig **config; - if (!forceNewgameSetting) { - config = (_game_mode == GM_MENU) ? &_settings_newgame.ai_config[company] : &_settings_game.ai_config[company]; - } else { + if (source == AISS_FORCE_NEWGAME || (source == AISS_DEFAULT && _game_mode == GM_MENU)) { config = &_settings_newgame.ai_config[company]; + } else { + config = &_settings_game.ai_config[company]; } if (*config == NULL) *config = new AIConfig(); return *config; |