3 | for (ScriptConfigItemList::const_iterator it = this->GetConfigList()->begin(); it != this->GetConfigList()->end(); it++) {
| 3 | ScriptConfigItemList::const_iterator it = NULL;
|
---|
4 | if ((*it).random_deviation != 0) {
| 4 | for (it = this->GetConfigList()->begin(); it != this->GetConfigList()->end(); it++) {
|
---|
5 | int value = this->GetSetting((*it).name);
| 5 | /* start_date = 0 is a special case, where random deviation does not occur. */
|
---|
6 | int r = InteractiveRandomRange((*it).random_deviation * 2) - (*it).random_deviation + value;
| 6 | if ((*it).random_deviation != 0 && StrEmpty((*it).description) && strcmp((*it).name, "start_date") == 0 && this->GetSetting((*it).name) == 0) {
|
---|
7 |
| 7 | break;
|
---|
8 | int dev = 0;
| | |
---|
9 | if (typeid(*this) == typeid(AIConfig) && StrEmpty((*it).description) && strcmp((*it).name, "start_date") != 0) {
| | |
---|
10 | dev = r;
| | |
---|
11 | } else if (value != 0) {
| | |
---|
12 | dev = max(1, r);
| | |
---|
13 | }
| | |
---|
14 | this->SetSetting((*it).name, dev);
| | |
---|