summaryrefslogtreecommitdiff
path: root/src/town_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-12-20 14:53:32 +0000
committerrubidium <rubidium@openttd.org>2009-12-20 14:53:32 +0000
commitee3a44e74f5f24fce5f0d1a975d38453b417201b (patch)
tree756e8891ae36b21381723f9ab4b7e1ea7b1ea5a4 /src/town_cmd.cpp
parent1e1fa9ff2eee6f194e2b3172f1cf0439113f50a6 (diff)
downloadopenttd-ee3a44e74f5f24fce5f0d1a975d38453b417201b.tar.xz
(svn r18567) -Fix [FS#2613]: [NewGRF] House property 15 did not work
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r--src/town_cmd.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 59745237d..c96c2d239 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -2094,7 +2094,7 @@ static bool BuildTownHouse(Town *t, TileIndex tile)
const HouseSpec *hs = HouseSpec::Get(i);
/* Verify that the candidate house spec matches the current tile status */
- if ((~hs->building_availability & bitmask) != 0 || !hs->enabled) continue;
+ if ((~hs->building_availability & bitmask) != 0 || !hs->enabled || hs->override != INVALID_HOUSE_ID) continue;
/* Don't let these counters overflow. Global counters are 32bit, there will never be that many houses. */
if (hs->class_id != HOUSE_NO_CLASS) {
@@ -2132,13 +2132,9 @@ static bool BuildTownHouse(Town *t, TileIndex tile)
const HouseSpec *hs = HouseSpec::Get(house);
- if (_loaded_newgrf_features.has_newhouses) {
- if (hs->override != 0) {
- house = hs->override;
- hs = HouseSpec::Get(house);
- }
-
- if ((hs->extra_flags & BUILDING_IS_HISTORICAL) && !_generating_world && _game_mode != GM_EDITOR) continue;
+ if (_loaded_newgrf_features.has_newhouses && !_generating_world &&
+ _game_mode != GM_EDITOR && (hs->extra_flags & BUILDING_IS_HISTORICAL) != 0) {
+ continue;
}
if (_cur_year < hs->min_year || _cur_year > hs->max_year) continue;