Loading

Paste #pwzj5uvjx

  1. void ScriptConfig::ResetChangeableSettings()
  2. {
  3.     for (SettingValueList::iterator it = this->settings.begin(); it != this->settings.end();) {
  4.         const ScriptConfigItem *config_item = this->info->GetConfigItem((*it).first);
  5.         assert(config_item != NULL);
  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) {
  17.             free((*it).first);
  18.             it = this->settings.erase(it);
  19.         } else {
  20.             it++;
  21.         }
  22.     }
  23. }

Version history

Revision # Author Created at
pc2vjstnz Anonymous 27 Jan 2019, 00:12:00 UTC Diff
pa7nscczm Anonymous 26 Jan 2019, 22:20:50 UTC Diff

Comments