Mercurial > hg > openttd
changeset 4617:2a1e78676c84 draft
(svn r6475) - Fix (r6055): Don't try to sort industries when there are none. Thanks to 'Delboy'
author | peter1138 <peter1138@openttd.org> |
---|---|
date | Mon, 18 Sep 2006 06:34:37 +0000 |
parents | cef7b22ec4f6 |
children | ef5af7bbac33 |
files | industry_gui.c |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/industry_gui.c +++ b/industry_gui.c @@ -556,6 +556,9 @@ const Industry* i; int n = 0; + /* Don't attempt a sort if there are no industries */ + if (GetIndustryArraySize() == 0) return; + /* Create array for sorting */ _industry_sort = realloc((void *)_industry_sort, GetIndustryArraySize() * sizeof(_industry_sort[0])); if (_industry_sort == NULL)