(svn r7477) -Fix (7451): Allocate(Industry|Town) get called twice when trying to build an industry/town via a command, thus incrementing the number of towns/industries twice when created via a command.

This commit is contained in:
rubidium
2006-12-11 12:37:57 +00:00
parent 2b5413df43
commit 8b646c3cb2
2 changed files with 2 additions and 4 deletions

View File

@@ -1362,8 +1362,6 @@ static Industry *AllocateIndustry(void)
if (IsValidIndustry(i)) continue;
_total_industries++;
memset(i, 0, sizeof(*i));
i->index = index;
@@ -1380,6 +1378,7 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, int type, const Ind
uint32 r;
int j;
_total_industries++;
i->xy = tile;
i->width = i->height = 0;
i->type = type;