Old revision #pc2vjstnz | New revision #pwzj5uvjx | ||
---|---|---|---|
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 mask = SCRIPTCONFIG_INGAME; | 7 | bool erase = false; |
10 | if (!_settings_client.gui.ai_developer_tools) mask |= SCRIPTCONFIG_DEVELOPER; | 8 | if (_game_mode == GM_MENU || ((*config_item).flags & SCRIPTCONFIG_INGAME) != 0) { |
9 | erase = true; | ||
10 | } | ||
11 | 11 | ||
12 | if (_game_mode == GM_MENU || ((*config_item).flags & mask) != 0) { | 12 | if (!_settings_client.gui.ai_developer_tools && ((*config_item).flags & SCRIPTCONFIG_DEVELOPER) != 0) { |
13 | erase = false; | ||
14 | } | ||
15 | |||
16 | if (erase) { | ||
13 | free((*it).first); | 17 | free((*it).first); |
14 | it = this->settings.erase(it); | 18 | it = this->settings.erase(it); |
15 | } else { | 19 | } else { |