Old revision #pa7nscczm | New revision #p3c6qc5ys | ||
---|---|---|---|
1 | void ScriptConfig::ResetChangeableSettings() | 1 | void ScriptConfig::ResetChangeableSettings() |
2 | { | 2 | { |
3 | if (this->info == NULL) return; | 3 | for (SettingValueList::iterator it = this->settings.begin(); it != this->settings.end();) { |
4 | |||
5 | for (SettingValueList::iterator it = this->settings.begin(); it != this->settings.end(); it++) { | ||
6 | const ScriptConfigItem *config_item = this->info->GetConfigItem((*it).first); | 4 | const ScriptConfigItem *config_item = this->info->GetConfigItem((*it).first); |
7 | assert(config_item != NULL); | 5 | assert(config_item != NULL); |
8 | if (((*config_item).flags & SCRIPTCONFIG_INGAME) == 0) { | 6 | |
7 | bool editable = _game_mode == GM_MENU || ((*config_item).flags & SCRIPTCONFIG_INGAME) != 0; | ||
8 | bool visible = !(!_settings_client.gui.ai_developer_tools && ((*config_item).flags & SCRIPTCONFIG_DEVELOPER) != 0); | ||
9 | |||
10 | if (editable && visible) { | ||
9 | free((*it).first); | 11 | free((*it).first); |
10 | this->settings.erase(it); | 12 | it = this->settings.erase(it); |
13 | } else { | ||
14 | it++; | ||
11 | } | 15 | } |
12 | } | 16 | } |
13 | |||
14 | } | 17 | } |