@@ -53,13 +53,13 @@
if (info == nullptr) {
info = AI::scanner_info->SelectRandomAI();
assert(info != nullptr);
/* Load default data and store the name in the settings */
config->Change(info->GetName(), -1, false);
}
if (deviate) config->AddRandomDeviation();
if (deviate) config->AddRandomDeviation(company);
config->AnchorUnchangeableSettings();
c->ai_info = info;
assert(c->ai_instance == nullptr);
c->ai_instance = new AIInstance();
c->ai_instance->Initialize(info);
@@ -80,13 +80,13 @@
if (_networking && !_network_server) return;
GameConfig *config = GameConfig::GetConfig(GameConfig::SSS_FORCE_GAME);
GameInfo *info = config->GetInfo();
if (info == nullptr) return;
if (deviate) config->AddRandomDeviation(OWNER_DEITY);
Backup<CompanyID> cur_company(_current_company, FILE_LINE);
cur_company.Change(OWNER_DEITY);
Game::info = info;
@@ -120,17 +120,17 @@ void ScriptConfig::ResetEditableSettings
} else {
it++;
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));
bool ScriptConfig::HasScript() const
@@ -132,13 +132,13 @@ public:
*/
void ResetEditableSettings(bool yet_to_start);
/**
* 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
* that is assigned to this slot.
bool HasScript() const;
Status change: