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

Function RoadStopUpdateCachedTriggers

src/newgrf_roadstop.cpp:659–671  ·  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

657 * @param st Station to update.
658 */
659void RoadStopUpdateCachedTriggers(BaseStation *st)
660{
661 st->cached_roadstop_anim_triggers = {};
662 st->cached_roadstop_cargo_triggers = 0;
663
664 /* Combine animation trigger bitmask for all road stop specs
665 * of this station. */
666 for (const auto &sm : GetStationSpecList<RoadStopSpec>(st)) {
667 if (sm.spec == nullptr) continue;
668 st->cached_roadstop_anim_triggers.Set(sm.spec->animation.triggers);
669 st->cached_roadstop_cargo_triggers |= sm.spec->cargo_triggers;
670 }
671}

Callers 3

AssignSpecToRoadStopFunction · 0.85
AfterLoadStationsFunction · 0.85

Calls 1

SetMethod · 0.45

Tested by

no test coverage detected