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

Function IncreaseBuildingCount

src/newgrf_house.cpp:191–202  ·  view source on GitHub ↗

* IncreaseBuildingCount() * Increase the count of a building when it has been added by a town. * @param t The town that the building is being built in * @param house_id The id of the house being added */

Source from the content-addressed store, hash-verified

189 * @param house_id The id of the house being added
190 */
191void IncreaseBuildingCount(Town *t, HouseID house_id)
192{
193 HouseClassID class_id = HouseSpec::Get(house_id)->class_id;
194
195 t->cache.building_counts.id_count[house_id]++;
196 _building_counts.id_count[house_id]++;
197
198 if (class_id == HOUSE_NO_CLASS) return;
199
200 t->cache.building_counts.class_count[class_id]++;
201 _building_counts.class_count[class_id]++;
202}
203
204/**
205 * DecreaseBuildingCount()

Callers 2

ClearMakeHouseTileFunction · 0.85
RebuildTownCachesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected