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

Function InitializeBuildingCounts

src/newgrf_house.cpp:153–159  ·  view source on GitHub ↗

* Initialise building counts for a town. * @param t Town cache to initialise. */

Source from the content-addressed store, hash-verified

151 * @param t Town cache to initialise.
152 */
153void InitializeBuildingCounts(Town *t)
154{
155 t->cache.building_counts.id_count.clear();
156 t->cache.building_counts.class_count.clear();
157 t->cache.building_counts.id_count.resize(HouseSpec::Specs().size());
158 t->cache.building_counts.class_count.resize(_class_mapping.size());
159}
160
161/**
162 * Initialise global building counts and all town building counts.

Callers 3

GenerateWorldFunction · 0.85
DoCreateTownFunction · 0.85
RebuildTownCachesFunction · 0.85

Calls 3

resizeMethod · 0.80
clearMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected