1
0
Fork 0

Codefix: GRF-local cargo id is not a CargoType. (#13888)

pull/13890/head
Peter Nelson 2025-03-25 17:12:43 +00:00 committed by GitHub
parent adb20f99ea
commit 9f94cadd68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View File

@ -390,13 +390,13 @@ void TriggerRoadStopAnimation(BaseStation *st, TileIndex trigger_tile, StationAn
auto process_tile = [&](TileIndex cur_tile) {
const RoadStopSpec *ss = GetRoadStopSpec(cur_tile);
if (ss != nullptr && HasBit(ss->animation.triggers, trigger)) {
CargoType cargo;
uint8_t local_cargo;
if (!IsValidCargoType(cargo_type)) {
cargo = INVALID_CARGO;
local_cargo = UINT8_MAX;
} else {
cargo = ss->grf_prop.grffile->cargo_map[cargo_type];
local_cargo = ss->grf_prop.grffile->cargo_map[cargo_type];
}
RoadStopAnimationBase::ChangeAnimationFrame(CBID_STATION_ANIM_START_STOP, ss, st, cur_tile, (random_bits << 16) | Random(), (uint8_t)trigger | (cargo << 8));
RoadStopAnimationBase::ChangeAnimationFrame(CBID_STATION_ANIM_START_STOP, ss, st, cur_tile, (random_bits << 16) | Random(), (uint8_t)trigger | (local_cargo << 8));
}
};

View File

@ -915,13 +915,13 @@ void TriggerStationAnimation(BaseStation *st, TileIndex trigger_tile, StationAni
if (st->TileBelongsToRailStation(tile)) {
const StationSpec *ss = GetStationSpec(tile);
if (ss != nullptr && HasBit(ss->animation.triggers, trigger)) {
CargoType cargo;
uint8_t local_cargo;
if (!IsValidCargoType(cargo_type)) {
cargo = INVALID_CARGO;
local_cargo = UINT8_MAX;
} else {
cargo = ss->grf_prop.grffile->cargo_map[cargo_type];
local_cargo = ss->grf_prop.grffile->cargo_map[cargo_type];
}
StationAnimationBase::ChangeAnimationFrame(CBID_STATION_ANIM_START_STOP, ss, st, tile, (random_bits << 16) | GB(Random(), 0, 16), (uint8_t)trigger | (cargo << 8));
StationAnimationBase::ChangeAnimationFrame(CBID_STATION_ANIM_START_STOP, ss, st, tile, (random_bits << 16) | GB(Random(), 0, 16), (uint8_t)trigger | (local_cargo << 8));
}
}
}