summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-10-04 20:20:50 +0000
committerfrosch <frosch@openttd.org>2010-10-04 20:20:50 +0000
commit510ef76386634e850597cbca75b5c5a7e0a0595e (patch)
treecfd2fe195b9f9ea20c3cd776b1244dd444e2a441 /src
parentc49debbe63f726cb5c7c3d0978d7036718c93b5e (diff)
downloadopenttd-510ef76386634e850597cbca75b5c5a7e0a0595e.tar.xz
(svn r20902) -Fix [FS#4032]: Make IsProductionAlterable() work for most NewGRF industries.
The NewGRF either has to use properties 12/13, or it needs to set property 0B to 'primary industry'. So it will not work for bank-like industries which use pure production-callback production.
Diffstat (limited to 'src')
-rw-r--r--src/industry_gui.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 920c8f240..b4ec15216 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -624,8 +624,9 @@ static void UpdateIndustryProduction(Industry *i);
static inline bool IsProductionAlterable(const Industry *i)
{
+ const IndustrySpec *is = GetIndustrySpec(i->type);
return ((_game_mode == GM_EDITOR || _cheats.setup_prod.value) &&
- (i->accepts_cargo[0] == CT_INVALID || i->accepts_cargo[0] == CT_VALUABLES));
+ (is->production_rate[0] != 0 || is->production_rate[1] != 0 || is->IsRawIndustry()));
}
/** Names of the widgets of the view industry gui */