summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-06-12 14:41:29 +0000
committerrubidium <rubidium@openttd.org>2008-06-12 14:41:29 +0000
commitc97a045f574e0aa76651125c2d86d1a3e55a324b (patch)
tree13dc89c178b256909df5ebb682f3bc826065c2f6 /src
parentfe6f09e66e489f54e395ef7424b7c3a2f1f7e1f0 (diff)
downloadopenttd-c97a045f574e0aa76651125c2d86d1a3e55a324b.tar.xz
(svn r13489) -Fix: first determine where to *exactly* build a house before asking a NewGRF whether the location is good instead of possibly moving the house a tile after the NewGRF said the location is good.
Diffstat (limited to 'src')
-rw-r--r--src/town_cmd.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index a9256a1a5..a249b27c2 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -1929,11 +1929,6 @@ static bool BuildTownHouse(Town *t, TileIndex tile)
}
if ((hs->extra_flags & BUILDING_IS_HISTORICAL) && !_generating_world) continue;
-
- if (HasBit(hs->callback_mask, CBM_HOUSE_ALLOW_CONSTRUCTION)) {
- uint16 callback_res = GetHouseCallback(CBID_HOUSE_ALLOW_CONSTRUCTION, 0, 0, house, t, tile);
- if (callback_res != CALLBACK_FAILED && GB(callback_res, 0, 8) == 0) continue;
- }
}
if (_cur_year < hs->min_year || _cur_year > hs->max_year) continue;
@@ -1947,7 +1942,7 @@ static bool BuildTownHouse(Town *t, TileIndex tile)
SetBit(oneof, TOWN_HAS_STADIUM);
}
- if (HASBITS(t->flags12 , oneof)) continue;
+ if (HASBITS(t->flags12, oneof)) continue;
/* Make sure there is no slope? */
bool noslope = (hs->building_flags & TILE_NOT_SLOPED) != 0;
@@ -1963,6 +1958,11 @@ static bool BuildTownHouse(Town *t, TileIndex tile)
/* 1x1 house checks are already done */
}
+ if (HasBit(hs->callback_mask, CBM_HOUSE_ALLOW_CONSTRUCTION)) {
+ uint16 callback_res = GetHouseCallback(CBID_HOUSE_ALLOW_CONSTRUCTION, 0, 0, house, t, tile);
+ if (callback_res != CALLBACK_FAILED && GB(callback_res, 0, 8) == 0) continue;
+ }
+
/* build the house */
t->num_houses++;
IncreaseBuildingCount(t, house);