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

Function StationUpdateCachedTriggers

src/newgrf_station.cpp:1025–1037  ·  view source on GitHub ↗

* Update the cached animation trigger bitmask for a station. * @param st Station to update. */

Source from the content-addressed store, hash-verified

1023 * @param st Station to update.
1024 */
1025void StationUpdateCachedTriggers(BaseStation *st)
1026{
1027 st->cached_anim_triggers = {};
1028 st->cached_cargo_triggers = 0;
1029
1030 /* Combine animation trigger bitmask for all station specs
1031 * of this station. */
1032 for (const auto &sm : GetStationSpecList<StationSpec>(st)) {
1033 if (sm.spec == nullptr) continue;
1034 st->cached_anim_triggers.Set(sm.spec->animation.triggers);
1035 st->cached_cargo_triggers |= sm.spec->cargo_triggers;
1036 }
1037}
1038

Callers 3

AssignSpecToStationFunction · 0.85
AfterLoadStationsFunction · 0.85

Calls 1

SetMethod · 0.45

Tested by

no test coverage detected