summaryrefslogtreecommitdiff
path: root/src/newgrf_house.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-01-04 15:32:25 +0000
committersmatz <smatz@openttd.org>2009-01-04 15:32:25 +0000
commit7368c740a646c958797b5dff90d6c5b51236e2a4 (patch)
tree56e0ff1f4048e467cf123e92ca788c3c4bbc0f94 /src/newgrf_house.cpp
parentc9e8fd307e36b3d35f5bf7d01cffe64b1e75b846 (diff)
downloadopenttd-7368c740a646c958797b5dff90d6c5b51236e2a4.tar.xz
(svn r14828) -Codechange: move most of save/load-specific code to separate files
Diffstat (limited to 'src/newgrf_house.cpp')
-rw-r--r--src/newgrf_house.cpp47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp
index ce7558f97..c02e0e42b 100644
--- a/src/newgrf_house.cpp
+++ b/src/newgrf_house.cpp
@@ -34,53 +34,6 @@ static HouseClassMapping _class_mapping[HOUSE_CLASS_MAX];
HouseOverrideManager _house_mngr(NEW_HOUSE_OFFSET, HOUSE_MAX, INVALID_HOUSE_ID);
-/**
- * Check and update town and house values.
- *
- * Checked are the HouseIDs. Updated are the
- * town population the number of houses per
- * town, the town radius and the max passengers
- * of the town.
- */
-void UpdateHousesAndTowns()
-{
- Town *town;
- InitializeBuildingCounts();
-
- /* Reset town population and num_houses */
- FOR_ALL_TOWNS(town) {
- town->population = 0;
- town->num_houses = 0;
- }
-
- for (TileIndex t = 0; t < MapSize(); t++) {
- HouseID house_id;
-
- if (!IsTileType(t, MP_HOUSE)) continue;
-
- house_id = GetHouseType(t);
- 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. */
- house_id = _house_mngr.GetSubstituteID(house_id);
- SetHouseType(t, house_id);
- }
-
- town = GetTownByTile(t);
- IncreaseBuildingCount(town, house_id);
- if (IsHouseCompleted(t)) town->population += GetHouseSpecs(house_id)->population;
-
- /* 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 */
- FOR_ALL_TOWNS(town) {
- UpdateTownRadius(town);
- UpdateTownMaxPass(town);
- }
-}
-
HouseClassID AllocateHouseClassID(byte grf_class_id, uint32 grfid)
{
/* Start from 1 because 0 means that no class has been assigned. */