summaryrefslogtreecommitdiff
path: root/src/newgrf_industries.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-05-01 17:53:25 +0000
committerfrosch <frosch@openttd.org>2010-05-01 17:53:25 +0000
commiteea1a772f26e76a9939f7a3472cf31dd43c349a6 (patch)
treeb0aa428266db0aac9fb7c6b70edce1c9fbc6d5f6 /src/newgrf_industries.cpp
parent50cbdfeed88febaeb038c5d6876a8d365a7a6ec7 (diff)
downloadopenttd-eea1a772f26e76a9939f7a3472cf31dd43c349a6.tar.xz
(svn r19748) -Fix (r19743): Callback 22 and 38 are called with ind == NULL.
Diffstat (limited to 'src/newgrf_industries.cpp')
-rw-r--r--src/newgrf_industries.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp
index f7419149d..d9aa81477 100644
--- a/src/newgrf_industries.cpp
+++ b/src/newgrf_industries.cpp
@@ -346,15 +346,13 @@ static const SpriteGroup *IndustryResolveReal(const ResolverObject *object, cons
static uint32 IndustryGetRandomBits(const ResolverObject *object)
{
const Industry *ind = object->u.industry.ind;
- assert(ind != NULL);
- return ind->random;
+ return ind != NULL ? ind->random: 0;
}
static uint32 IndustryGetTriggers(const ResolverObject *object)
{
const Industry *ind = object->u.industry.ind;
- assert(ind != NULL);
- return ind->random_triggers;
+ return ind != NULL ? ind->random_triggers : 0;
}
static void IndustrySetTriggers(const ResolverObject *object, int triggers)