Old revision #pc2vjstnz | New revision #p3c6qc5ys | ||
---|---|---|---|
1 | void ScriptConfig::ResetChangeableSettings() | 1 | void ScriptConfig::ResetChangeableSettings() |
2 | { | 2 | { |
3 | |||
4 | |||
5 | for (SettingValueList::iterator it = this->settings.begin(); it != this->settings.end();) { | 3 | for (SettingValueList::iterator it = this->settings.begin(); it != this->settings.end();) { |
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 | 6 | ||
9 | bool | 9 | bool editable = _game_mode == GM_MENU || ((*config_item).flags & SCRIPTCONFIG_INGAME) != 0; |
10 | | 10 | bool visible = !(!_settings_client.gui.ai_developer_tools && ((*config_item).flags & SCRIPTCONFIG_DEVELOPER) != 0); |
11 | 9 | ||
12 | if ( | 12 | if (editable && visible) { |
13 | free((*it).first); | 11 | free((*it).first); |
14 | it = this->settings.erase(it); | 12 | it = this->settings.erase(it); |
15 | } else { | 13 | } else { |