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

Function SetPartOfSubsidyFlag

src/subsidy.cpp:93–100  ·  view source on GitHub ↗

* Sets a flag indicating that given town/industry is part of subsidised route. * @param source actual source * @param flag flag to set */

Source from the content-addressed store, hash-verified

91 * @param flag flag to set
92 */
93static inline void SetPartOfSubsidyFlag(Source source, PartOfSubsidy flag)
94{
95 switch (source.type) {
96 case SourceType::Industry: Industry::Get(source.ToIndustryID())->part_of_subsidy.Set(flag); return;
97 case SourceType::Town: Town::Get(source.ToTownID())->cache.part_of_subsidy.Set(flag); return;
98 default: NOT_REACHED();
99 }
100}
101
102/** Perform a full rebuild of the subsidies cache. */
103void RebuildSubsidisedSourceAndDestinationCache()

Callers 2

CreateSubsidyFunction · 0.85

Calls 4

NOT_REACHEDFunction · 0.85
ToIndustryIDMethod · 0.80
ToTownIDMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected