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

Function UpdateTownGrowthRate

src/town_cmd.cpp:3863–3870  ·  view source on GitHub ↗

* Updates town growth rate. * @param t The town to update growth rate for */

Source from the content-addressed store, hash-verified

3861 * @param t The town to update growth rate for
3862 */
3863static void UpdateTownGrowthRate(Town *t)
3864{
3865 if (t->flags.Test(TownFlag::CustomGrowth)) return;
3866 uint old_rate = t->growth_rate;
3867 t->growth_rate = GetNormalGrowthRate(t);
3868 UpdateTownGrowCounter(t, old_rate);
3869 SetWindowDirty(WC_TOWN_VIEW, t->index);
3870}
3871
3872/**
3873 * Updates town growth state (whether it is growing or not).

Callers 3

DoCreateTownFunction · 0.85
BuildTownHouseFunction · 0.85
UpdateTownGrowthFunction · 0.85

Calls 4

GetNormalGrowthRateFunction · 0.85
UpdateTownGrowCounterFunction · 0.85
SetWindowDirtyFunction · 0.85
TestMethod · 0.80

Tested by

no test coverage detected