summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-08-23 18:05:51 +0000
committerbelugas <belugas@openttd.org>2007-08-23 18:05:51 +0000
commit64da09f45252bc9aa0c0fccd066b0cbd036444bf (patch)
tree89352c710ffff889b808000952c415c0a298bc4c /src
parentec1d0811a462bab853027d8d58bae626ad9a8523 (diff)
downloadopenttd-64da09f45252bc9aa0c0fccd066b0cbd036444bf.tar.xz
(svn r10968) -Codechange: Remove a tileloop performed in the AfterLoadCountBuildings function and use the main loop of CheckhouseIDs instead
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_house.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp
index bbc7c19c8..b66d1be38 100644
--- a/src/newgrf_house.cpp
+++ b/src/newgrf_house.cpp
@@ -33,6 +33,8 @@ HouseOverrideManager _house_mngr(NEW_HOUSE_OFFSET, HOUSE_MAX, INVALID_HOUSE_ID);
void CheckHouseIDs()
{
+ InitializeBuildingCounts();
+
for (TileIndex t = 0; t < MapSize(); t++) {
HouseID house_id;
@@ -42,13 +44,11 @@ void CheckHouseIDs()
if (!GetHouseSpecs(house_id)->enabled && house_id >= NEW_HOUSE_OFFSET) {
/* The specs for this type of house are not available any more, so
* replace it with the substitute original house type. */
- SetHouseType(t, _house_mngr.GetSubstituteID(house_id));
+ house_id = _house_mngr.GetSubstituteID(house_id);
+ SetHouseType(t, house_id);
}
+ IncreaseBuildingCount(GetTownByTile(t), house_id);
}
-
- InitializeBuildingCounts();
- AfterLoadCountBuildings();
-
}
HouseClassID AllocateHouseClassID(byte grf_class_id, uint32 grfid)