mirror of https://github.com/OpenTTD/OpenTTD
Codefix: GRF-local cargo id is not a CargoType. (#13888)
parent
adb20f99ea
commit
9f94cadd68
|
@ -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));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue