mirror of https://github.com/OpenTTD/OpenTTD
pull/7243/head
parent
75d3054ae4
commit
aa737715dd
|
@ -35,6 +35,15 @@ ScriptConfigItem _start_date_config = {
|
||||||
false
|
false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
AIConfig::AIConfig(const AIConfig *config) : ScriptConfig(config)
|
||||||
|
{
|
||||||
|
/* Override start_date as per AIConfig::AddRandomDeviation().
|
||||||
|
* This is necessary because the ScriptConfig constructor will instead call
|
||||||
|
* ScriptConfig::AddRandomDeviation(). */
|
||||||
|
int start_date = config->GetSetting("start_date");
|
||||||
|
this->SetSetting("start_date", start_date != 0 ? max(1, this->GetSetting("start_date")) : 0);
|
||||||
|
}
|
||||||
|
|
||||||
/* static */ AIConfig *AIConfig::GetConfig(CompanyID company, ScriptSettingSource source)
|
/* static */ AIConfig *AIConfig::GetConfig(CompanyID company, ScriptSettingSource source)
|
||||||
{
|
{
|
||||||
AIConfig **config;
|
AIConfig **config;
|
||||||
|
|
|
@ -26,9 +26,7 @@ public:
|
||||||
ScriptConfig()
|
ScriptConfig()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
AIConfig(const AIConfig *config) :
|
AIConfig(const AIConfig *config);
|
||||||
ScriptConfig(config)
|
|
||||||
{}
|
|
||||||
|
|
||||||
class AIInfo *GetInfo() const;
|
class AIInfo *GetInfo() const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue