void ScriptConfig::AddRandomDeviation(bool is_ai)
{
for (ScriptConfigItemList::const_iterator it = this->GetConfigList()->begin(); it != this->GetConfigList()->end(); it++) {
if ((*it).random_deviation != 0) {
int value = this->GetSetting((*it).name);
int r = InteractiveRandomRange((*it).random_deviation * 2) - (*it).random_deviation + value;
int dev = 0;
if (typeid(*this) == typeid(AIConfig) && StrEmpty((*it).description) && strcmp((*it).name, "start_date") != 0) {
dev = r;
} else if (value != 0) {
dev = max(1, r);
}
this->SetSetting((*it).name, dev);
}
}
}