Loading

Paste #pdfskp6jj

  1. void ScriptConfig::AddRandomDeviation()
  2. {
  3.     for (ScriptConfigItemList::const_iterator it = this->GetConfigList()->begin(); it != this->GetConfigList()->end(); it++) {
  4.         if ((*it).random_deviation != 0) {
  5.             int value = this->GetSetting((*it).name);
  6.             uint32 r = InteractiveRandomRange((*it).random_deviation * 2) - (*it).random_deviation + value;
  7.             this->SetSetting((*it).name, !strcmp((*it).name, "start_date") ? r : value != 0 ? max((uint32)1, r) : 0);
  8.         }
  9.     }
  10. }

Comments