summaryrefslogtreecommitdiff
path: root/src/newgrf_house.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-07-18 12:20:31 +0000
committerrubidium <rubidium@openttd.org>2008-07-18 12:20:31 +0000
commit9d035df146a1e74cb0a6233da8da648e96612847 (patch)
tree4078e72d712819e0fd700a261befe428e069ee52 /src/newgrf_house.cpp
parentfaae16cddc0a2b9b4d09287faaa07e7db0e62110 (diff)
downloadopenttd-9d035df146a1e74cb0a6233da8da648e96612847.tar.xz
(svn r13729) -Fix: assumption that non-north tiles of a house do not have the 1x1 building bit set was flawed with some NewGRFs. This caused the amount of houses to differ, which causes the town radii to differ, which causes desyncs when towns are expanded.
Diffstat (limited to 'src/newgrf_house.cpp')
-rw-r--r--src/newgrf_house.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp
index cb5ac90df..bef7b3797 100644
--- a/src/newgrf_house.cpp
+++ b/src/newgrf_house.cpp
@@ -69,12 +69,8 @@ void UpdateHousesAndTowns()
IncreaseBuildingCount(town, house_id);
if (IsHouseCompleted(t)) town->population += GetHouseSpecs(house_id)->population;
- /* Increase the number of houses for every house tile which
- * has a size bit set. Multi tile buildings have got only
- * one tile with such a bit set, so there is no problem. */
- if (GetHouseSpecs(GetHouseType(t))->building_flags & BUILDING_HAS_1_TILE) {
- town->num_houses++;
- }
+ /* Increase the number of houses for every house, but only once. */
+ if (GetHouseNorthPart(house_id) == 0) town->num_houses++;
}
/* Update the population and num_house dependant values */