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

Function DeleteSubsidyWith

src/subsidy.cpp:119–134  ·  view source on GitHub ↗

* Delete the subsidies associated with a given cargo source type and id. * @param source The source to look for. */

Source from the content-addressed store, hash-verified

117 * @param source The source to look for.
118 */
119void DeleteSubsidyWith(Source source)
120{
121 bool dirty = false;
122
123 for (Subsidy *s : Subsidy::Iterate()) {
124 if (s->src == source || s->dst == source) {
125 delete s;
126 dirty = true;
127 }
128 }
129
130 if (dirty) {
131 InvalidateWindowData(WC_SUBSIDIES_LIST, 0);
132 RebuildSubsidisedSourceAndDestinationCache();
133 }
134}
135
136/**
137 * Check whether a specific subsidy already exists.

Callers 2

~IndustryMethod · 0.85
~TownMethod · 0.85

Tested by

no test coverage detected