Loading

Revision differences

Old revision #pc2vjstnzNew revision #p3c6qc5ys
1void ScriptConfig::ResetChangeableSettings()  1void ScriptConfig::ResetChangeableSettings()  
2{  2{  
3    if (this->info == NULL) return;    
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 mask = SCRIPTCONFIG_INGAME;  9        bool editable = _game_mode == GM_MENU || ((*config_item).flags & SCRIPTCONFIG_INGAME) != 0;
10        if (!_settings_client.gui.ai_developer_tools) mask |= SCRIPTCONFIG_DEVELOPER;  10        bool visible = !(!_settings_client.gui.ai_developer_tools && ((*config_item).flags & SCRIPTCONFIG_DEVELOPER) != 0);
11  9  
12        if (_game_mode == GM_MENU || ((*config_item).flags & mask) != 0) {  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 {