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

Function FindFirstCargoWithTownAcceptanceEffect

src/town_cmd.cpp:3127–3133  ·  view source on GitHub ↗

* Determines the first cargo with a certain town effect * @param effect Town effect of interest * @return first active cargo slot with that effect */

Source from the content-addressed store, hash-verified

3125 * @return first active cargo slot with that effect
3126 */
3127const CargoSpec *FindFirstCargoWithTownAcceptanceEffect(TownAcceptanceEffect effect)
3128{
3129 for (const CargoSpec *cs : CargoSpec::Iterate()) {
3130 if (cs->town_acceptance_effect == effect) return cs;
3131 }
3132 return nullptr;
3133}
3134
3135/**
3136 * Change the cargo goal of a town.

Callers 4

DrawWidgetMethod · 0.85
DoCreateTownFunction · 0.85
CmdTownCargoGoalFunction · 0.85
AfterLoadGameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected