mirror of https://github.com/OpenTTD/OpenTTD
(svn r18276) -Fix: [NoAI] Make AIIndustryType::GetConstructionCost() return -1, if the industry is neither buildable nor prospectable.
parent
7d355a58f3
commit
91865c33da
|
@ -6934,7 +6934,7 @@
|
||||||
Id: 9
|
Id: 9
|
||||||
IsRawIndustry(): true
|
IsRawIndustry(): true
|
||||||
ProductionCanIncrease(): true
|
ProductionCanIncrease(): true
|
||||||
GetConstructionCost(): 747070
|
GetConstructionCost(): -1
|
||||||
GetName(): Farm
|
GetName(): Farm
|
||||||
CanBuildIndustry(): false
|
CanBuildIndustry(): false
|
||||||
CanProspectIndustry(): false
|
CanProspectIndustry(): false
|
||||||
|
@ -6944,7 +6944,7 @@
|
||||||
Id: 5
|
Id: 5
|
||||||
IsRawIndustry(): true
|
IsRawIndustry(): true
|
||||||
ProductionCanIncrease(): true
|
ProductionCanIncrease(): true
|
||||||
GetConstructionCost(): 747070
|
GetConstructionCost(): -1
|
||||||
GetName(): Oil Rig
|
GetName(): Oil Rig
|
||||||
CanBuildIndustry(): false
|
CanBuildIndustry(): false
|
||||||
CanProspectIndustry(): false
|
CanProspectIndustry(): false
|
||||||
|
@ -6964,7 +6964,7 @@
|
||||||
Id: 11
|
Id: 11
|
||||||
IsRawIndustry(): true
|
IsRawIndustry(): true
|
||||||
ProductionCanIncrease(): false
|
ProductionCanIncrease(): false
|
||||||
GetConstructionCost(): 747070
|
GetConstructionCost(): -1
|
||||||
GetName(): Oil Wells
|
GetName(): Oil Wells
|
||||||
CanBuildIndustry(): false
|
CanBuildIndustry(): false
|
||||||
CanProspectIndustry(): false
|
CanProspectIndustry(): false
|
||||||
|
@ -6984,7 +6984,7 @@
|
||||||
Id: 3
|
Id: 3
|
||||||
IsRawIndustry(): true
|
IsRawIndustry(): true
|
||||||
ProductionCanIncrease(): true
|
ProductionCanIncrease(): true
|
||||||
GetConstructionCost(): 747070
|
GetConstructionCost(): -1
|
||||||
GetName(): Forest
|
GetName(): Forest
|
||||||
CanBuildIndustry(): false
|
CanBuildIndustry(): false
|
||||||
CanProspectIndustry(): false
|
CanProspectIndustry(): false
|
||||||
|
@ -7004,7 +7004,7 @@
|
||||||
Id: 18
|
Id: 18
|
||||||
IsRawIndustry(): true
|
IsRawIndustry(): true
|
||||||
ProductionCanIncrease(): true
|
ProductionCanIncrease(): true
|
||||||
GetConstructionCost(): 747070
|
GetConstructionCost(): -1
|
||||||
GetName(): Iron Ore Mine
|
GetName(): Iron Ore Mine
|
||||||
CanBuildIndustry(): false
|
CanBuildIndustry(): false
|
||||||
CanProspectIndustry(): false
|
CanProspectIndustry(): false
|
||||||
|
@ -7014,7 +7014,7 @@
|
||||||
Id: 0
|
Id: 0
|
||||||
IsRawIndustry(): true
|
IsRawIndustry(): true
|
||||||
ProductionCanIncrease(): true
|
ProductionCanIncrease(): true
|
||||||
GetConstructionCost(): 747070
|
GetConstructionCost(): -1
|
||||||
GetName(): Coal Mine
|
GetName(): Coal Mine
|
||||||
CanBuildIndustry(): false
|
CanBuildIndustry(): false
|
||||||
CanProspectIndustry(): false
|
CanProspectIndustry(): false
|
||||||
|
|
|
@ -39,7 +39,8 @@
|
||||||
|
|
||||||
/* static */ Money AIIndustryType::GetConstructionCost(IndustryType industry_type)
|
/* static */ Money AIIndustryType::GetConstructionCost(IndustryType industry_type)
|
||||||
{
|
{
|
||||||
if (!IsValidIndustryType(industry_type)) return false;
|
if (!IsValidIndustryType(industry_type)) return -1;
|
||||||
|
if (::GetIndustrySpec(industry_type)->IsRawIndustry() && _settings_game.construction.raw_industry_construction == 0) return -1;
|
||||||
|
|
||||||
return ::GetIndustrySpec(industry_type)->GetConstructionCost();
|
return ::GetIndustrySpec(industry_type)->GetConstructionCost();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue