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

Function RebuildSubsidisedSourceAndDestinationCache

src/subsidy.cpp:103–113  ·  view source on GitHub ↗

Perform a full rebuild of the subsidies cache. */

Source from the content-addressed store, hash-verified

101
102/** Perform a full rebuild of the subsidies cache. */
103void RebuildSubsidisedSourceAndDestinationCache()
104{
105 for (Town *t : Town::Iterate()) t->cache.part_of_subsidy = {};
106
107 for (Industry *i : Industry::Iterate()) i->part_of_subsidy = {};
108
109 for (const Subsidy *s : Subsidy::Iterate()) {
110 SetPartOfSubsidyFlag(s->src, PartOfSubsidy::Source);
111 SetPartOfSubsidyFlag(s->dst, PartOfSubsidy::Destination);
112 }
113}
114
115/**
116 * Delete the subsidies associated with a given cargo source type and id.

Callers 5

DeleteSubsidyWithFunction · 0.85
subsidy.cppFile · 0.85
CheckCachesFunction · 0.85

Calls 1

SetPartOfSubsidyFlagFunction · 0.85

Tested by

no test coverage detected