From 07f2afa635c0ddfa491468cc3f8677cd0d869c6d Mon Sep 17 00:00:00 2001 From: truebrain Date: Tue, 13 Jan 2009 13:09:49 +0000 Subject: (svn r15057) -Fix [NoAI]: clamp the values of a setting between the ones allowed by info.nut --- src/ai/ai_info.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ai/ai_info.cpp') diff --git a/src/ai/ai_info.cpp b/src/ai/ai_info.cpp index 9e439cce2..c68972c45 100644 --- a/src/ai/ai_info.cpp +++ b/src/ai/ai_info.cpp @@ -295,6 +295,14 @@ const AIConfigItemList *AIInfo::GetConfigList() return &this->config_list; } +const AIConfigItem *AIInfo::GetConfigItem(const char *name) +{ + for (AIConfigItemList::iterator it = this->config_list.begin(); it != this->config_list.end(); it++) { + if (strcmp((*it).name, name) == 0) return &(*it); + } + return NULL; +} + int AIInfo::GetSettingDefaultValue(const char *name) { for (AIConfigItemList::iterator it = this->config_list.begin(); it != this->config_list.end(); it++) { -- cgit v1.2.3-54-g00ecf