From 7368c740a646c958797b5dff90d6c5b51236e2a4 Mon Sep 17 00:00:00 2001 From: smatz Date: Sun, 4 Jan 2009 15:32:25 +0000 Subject: (svn r14828) -Codechange: move most of save/load-specific code to separate files --- src/newgrf_house.cpp | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) (limited to 'src/newgrf_house.cpp') 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. */ -- cgit v1.2.3-54-g00ecf