diff options
Diffstat (limited to 'industry_cmd.c')
-rw-r--r-- | industry_cmd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/industry_cmd.c b/industry_cmd.c index ec4693304..e360cad95 100644 --- a/industry_cmd.c +++ b/industry_cmd.c @@ -110,6 +110,7 @@ void DestroyIndustry(Industry *i) } _industry_sort_dirty = true; + _total_industries--; DeleteSubsidyWithIndustry(i->index); DeleteWindowById(WC_INDUSTRY_VIEW, i->index); InvalidateWindow(WC_INDUSTRY_DIRECTORY, 0); @@ -1361,7 +1362,7 @@ static Industry *AllocateIndustry(void) if (IsValidIndustry(i)) continue; - if (i->index >= _total_industries) _total_industries = i->index + 1; + _total_industries++; memset(i, 0, sizeof(*i)); i->index = index; @@ -1917,7 +1918,7 @@ static void Load_INDY(void) i = GetIndustry(index); SlObject(i, _industry_desc); - if (index >= _total_industries) _total_industries = index + 1; + _total_industries++; } } |