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