MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / DecreaseBuildingCount

Function DecreaseBuildingCount

src/newgrf_house.cpp:210–221  ·  view source on GitHub ↗

* DecreaseBuildingCount() * Decrease the number of a building when it is deleted. * @param t The town that the building was built in * @param house_id The id of the house being removed */

Source from the content-addressed store, hash-verified

208 * @param house_id The id of the house being removed
209 */
210void DecreaseBuildingCount(Town *t, HouseID house_id)
211{
212 HouseClassID class_id = HouseSpec::Get(house_id)->class_id;
213
214 if (t->cache.building_counts.id_count[house_id] > 0) t->cache.building_counts.id_count[house_id]--;
215 if (_building_counts.id_count[house_id] > 0) _building_counts.id_count[house_id]--;
216
217 if (class_id == HOUSE_NO_CLASS) return;
218
219 if (t->cache.building_counts.class_count[class_id] > 0) t->cache.building_counts.class_count[class_id]--;
220 if (_building_counts.class_count[class_id] > 0) _building_counts.class_count[class_id]--;
221}
222
223/* virtual */ uint32_t HouseScopeResolver::GetRandomBits() const
224{

Callers 1

DoClearTownHouseHelperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected