Change: [Script] Use company randomizer when adding random deviation (#12065)
This commit is contained in:
@@ -123,11 +123,11 @@ void ScriptConfig::ResetEditableSettings(bool yet_to_start)
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptConfig::AddRandomDeviation()
|
||||
void ScriptConfig::AddRandomDeviation(CompanyID owner)
|
||||
{
|
||||
for (const auto &item : *this->GetConfigList()) {
|
||||
if (item.random_deviation != 0) {
|
||||
this->SetSetting(item.name, ScriptObject::GetRandomizer(OWNER_NONE).Next(item.random_deviation * 2 + 1) - item.random_deviation + this->GetSetting(item.name));
|
||||
this->SetSetting(item.name, ScriptObject::GetRandomizer(owner).Next(item.random_deviation * 2 + 1) - item.random_deviation + this->GetSetting(item.name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -135,7 +135,7 @@ public:
|
||||
/**
|
||||
* Randomize all settings the Script requested to be randomized.
|
||||
*/
|
||||
void AddRandomDeviation();
|
||||
void AddRandomDeviation(CompanyID owner);
|
||||
|
||||
/**
|
||||
* Is this config attached to an Script? In other words, is there a Script
|
||||
|
Reference in New Issue
Block a user