Changeset - r23309:2b7537b92737
[Not reviewed]
master
0 2 0
PeterN - 6 years ago 2019-02-11 18:59:55
peter@fuzzle.org
Fix #7151: AI start date deviation was still applied when not set to a random AI. (#7223)
2 files changed with 10 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/ai/ai_config.cpp
Show inline comments
 
@@ -35,6 +35,15 @@ ScriptConfigItem _start_date_config = {
 
	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)
 
{
 
	AIConfig **config;
src/ai/ai_config.hpp
Show inline comments
 
@@ -26,9 +26,7 @@ public:
 
		ScriptConfig()
 
	{}
 

	
 
	AIConfig(const AIConfig *config) :
 
		ScriptConfig(config)
 
	{}
 
	AIConfig(const AIConfig *config);
 

	
 
	class AIInfo *GetInfo() const;
 

	
0 comments (0 inline, 0 general)