summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-11-24 17:56:45 +0000
committerfrosch <frosch@openttd.org>2009-11-24 17:56:45 +0000
commit91865c33da8df050165d8e692e22dde9048572ed (patch)
tree1e13e83f2948bf07afe02634ab664e357320af26 /src/ai
parent7d355a58f3be09cfdacdd1ecf5269604da0de9e6 (diff)
downloadopenttd-91865c33da8df050165d8e692e22dde9048572ed.tar.xz
(svn r18276) -Fix: [NoAI] Make AIIndustryType::GetConstructionCost() return -1, if the industry is neither buildable nor prospectable.
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/api/ai_industrytype.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ai/api/ai_industrytype.cpp b/src/ai/api/ai_industrytype.cpp
index 1f2084565..8bf892c8e 100644
--- a/src/ai/api/ai_industrytype.cpp
+++ b/src/ai/api/ai_industrytype.cpp
@@ -39,7 +39,8 @@
/* 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();
}