summaryrefslogtreecommitdiff
path: root/town_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 /town_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 'town_cmd.c')
-rw-r--r--town_cmd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/town_cmd.c b/town_cmd.c
index 98a563e89..99a821083 100644
--- a/town_cmd.c
+++ b/town_cmd.c
@@ -915,6 +915,7 @@ static void DoCreateTown(Town *t, TileIndex tile, uint32 townnameparts, uint siz
i = t->index;
memset(t, 0, sizeof(Town));
t->index = i;
+ _total_towns++;
t->xy = tile;
t->num_houses = 0;
@@ -984,8 +985,6 @@ static Town *AllocateTown(void)
if (!IsValidTown(t)) {
TownID index = t->index;
- _total_towns++;
-
memset(t, 0, sizeof(Town));
t->index = index;