(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.
authorrubidium
Fri, 18 Jul 2008 12:20:31 +0000
changeset 11171 04fc8e49df1b
parent 11170 3646f7f4fcfc
child 11172 116e540c4325
(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.
src/newgrf_house.cpp
--- a/src/newgrf_house.cpp	Fri Jul 18 12:20:30 2008 +0000
+++ b/src/newgrf_house.cpp	Fri Jul 18 12:20:31 2008 +0000
@@ -69,12 +69,8 @@
 		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 */