summaryrefslogtreecommitdiff
path: root/industry_cmd.c
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2006-12-11 12:37:57 +0000
committerrubidium <rubidium@openttd.org>2006-12-11 12:37:57 +0000
commit8d2c82bc2af1c970a8d21757f237c4b0d1f76d52 (patch)
tree21f3834054dd0957e7d27b7d7fc5f153e35bf8bb /industry_cmd.c
parentc3d65805e7017361a668f6edf9bb62bdd59fd630 (diff)
downloadopenttd-8d2c82bc2af1c970a8d21757f237c4b0d1f76d52.tar.xz
(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.
Diffstat (limited to 'industry_cmd.c')
-rw-r--r--industry_cmd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/industry_cmd.c b/industry_cmd.c
index e360cad95..ccec97c55 100644
--- a/industry_cmd.c
+++ b/industry_cmd.c
@@ -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;