(svn r25592) -Fix [FS#5644]: Changing the script difficulty level in-game would also change the settings using the default even though they were not allowed to change in-game

This commit is contained in:
rubidium
2013-07-12 18:54:27 +00:00
parent 99bf9ecbe5
commit f91f4f1f1a
4 changed files with 22 additions and 0 deletions

View File

@@ -84,6 +84,15 @@ void ScriptConfig::ClearConfigList()
this->settings.clear();
}
void ScriptConfig::AnchorUnchangeableSettings()
{
for (ScriptConfigItemList::const_iterator it = this->GetConfigList()->begin(); it != this->GetConfigList()->end(); it++) {
if (((*it).flags & SCRIPTCONFIG_INGAME) == 0) {
this->SetSetting((*it).name, this->GetSetting((*it).name));
}
}
}
int ScriptConfig::GetSetting(const char *name) const
{
SettingValueList::const_iterator it = this->settings.find(name);