summaryrefslogtreecommitdiff
path: root/industry_cmd.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2006-08-22 21:17:19 +0000
committertruelight <truelight@openttd.org>2006-08-22 21:17:19 +0000
commit93d5b5a35507be8944c929192421bbd2a43c6803 (patch)
treefa944d5ed41a5252bd051d2fc61ec3bd6800e94b /industry_cmd.c
parentceb523c29f364f24b5e6b68b13249187ff6ac371 (diff)
downloadopenttd-93d5b5a35507be8944c929192421bbd2a43c6803.tar.xz
(svn r6058) -Fix: Get(Industry|Town)ArraySize could never return 0
Note: _total_towns and _total_industries willb e removed soon, so this 'hack' is okay, for now ;)
Diffstat (limited to 'industry_cmd.c')
-rw-r--r--industry_cmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/industry_cmd.c b/industry_cmd.c
index 215033e13..43397b47d 100644
--- a/industry_cmd.c
+++ b/industry_cmd.c
@@ -1408,7 +1408,7 @@ static Industry *AllocateIndustry(void)
if (IsValidIndustry(i)) continue;
- if (i->index > _total_industries) _total_industries = i->index;
+ if (i->index >= _total_industries) _total_industries = i->index + 1;
memset(i, 0, sizeof(*i));
i->index = index;
@@ -1974,7 +1974,7 @@ static void Load_INDY(void)
i = GetIndustry(index);
SlObject(i, _industry_desc);
- if (index > _total_industries) _total_industries = index;
+ if (index >= _total_industries) _total_industries = index + 1;
}
}