Mercurial > hg > openttd
changeset 15119:1402966ce103 draft
(svn r19748) -Fix (r19743): Callback 22 and 38 are called with ind == NULL.
author | frosch <frosch@openttd.org> |
---|---|
date | Sat, 01 May 2010 17:53:25 +0000 |
parents | bdea5ced037a |
children | f2b9f984aca7 |
files | src/newgrf_industries.cpp |
diffstat | 1 files changed, 2 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/newgrf_industries.cpp +++ b/src/newgrf_industries.cpp @@ -346,15 +346,13 @@ 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)