diff --git a/src/newgrf_roadstop.cpp b/src/newgrf_roadstop.cpp --- a/src/newgrf_roadstop.cpp +++ b/src/newgrf_roadstop.cpp @@ -346,7 +346,7 @@ void TriggerRoadStopAnimation(BaseStatio const RoadStopSpec *ss = GetRoadStopSpec(cur_tile); if (ss != nullptr && HasBit(ss->animation.triggers, trigger)) { CargoID cargo; - if (cargo_type == CT_INVALID) { + if (!IsValidCargoID(cargo_type)) { cargo = CT_INVALID; } else { cargo = ss->grf_prop.grffile->cargo_map[cargo_type]; @@ -379,7 +379,7 @@ void TriggerRoadStopRandomisation(Statio /* Check the cached cargo trigger bitmask to see if we need * to bother with any further processing. */ if (st->cached_roadstop_cargo_triggers == 0) return; - if (cargo_type != CT_INVALID && !HasBit(st->cached_roadstop_cargo_triggers, cargo_type)) return; + if (IsValidCargoID(cargo_type) && !HasBit(st->cached_roadstop_cargo_triggers, cargo_type)) return; SetBit(st->waiting_triggers, trigger); @@ -406,7 +406,7 @@ void TriggerRoadStopRandomisation(Statio if ((ss->cargo_triggers & ~empty_mask) != 0) return; } - if (cargo_type == CT_INVALID || HasBit(ss->cargo_triggers, cargo_type)) { + if (!IsValidCargoID(cargo_type) || HasBit(ss->cargo_triggers, cargo_type)) { RoadStopResolverObject object(ss, st, cur_tile, INVALID_ROADTYPE, GetStationType(cur_tile), GetStationGfx(cur_tile)); object.waiting_triggers = st->waiting_triggers;