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