mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-04 21:33:51 +00:00
(svn r18681) -Codechange: Use existing TILE_LOOP method for iterating trigger area.
This commit is contained in:
parent
f77d88c0aa
commit
81dc77ee23
@ -1062,23 +1062,19 @@ void StationAnimationTrigger(const BaseStation *st, TileIndex tile, StatAnimTrig
|
|||||||
ETileArea area = ETileArea(st, tile, tas[trigger]);
|
ETileArea area = ETileArea(st, tile, tas[trigger]);
|
||||||
|
|
||||||
/* Check all tiles over the station to check if the specindex is still in use */
|
/* Check all tiles over the station to check if the specindex is still in use */
|
||||||
for (uint y = 0; y < area.h; y++) {
|
TILE_LOOP(tile, area.w, area.h, area.tile) {
|
||||||
for (uint x = 0; x < area.w; x++) {
|
if (st->TileBelongsToRailStation(tile)) {
|
||||||
if (st->TileBelongsToRailStation(area.tile)) {
|
const StationSpec *ss = GetStationSpec(tile);
|
||||||
const StationSpec *ss = GetStationSpec(area.tile);
|
if (ss != NULL && HasBit(ss->anim_triggers, trigger)) {
|
||||||
if (ss != NULL && HasBit(ss->anim_triggers, trigger)) {
|
CargoID cargo;
|
||||||
CargoID cargo;
|
if (cargo_type == CT_INVALID) {
|
||||||
if (cargo_type == CT_INVALID) {
|
cargo = CT_INVALID;
|
||||||
cargo = CT_INVALID;
|
} else {
|
||||||
} else {
|
cargo = GetReverseCargoTranslation(cargo_type, ss->grffile);
|
||||||
cargo = GetReverseCargoTranslation(cargo_type, ss->grffile);
|
|
||||||
}
|
|
||||||
ChangeStationAnimationFrame(ss, st, area.tile, random_bits, trigger, cargo);
|
|
||||||
}
|
}
|
||||||
|
ChangeStationAnimationFrame(ss, st, tile, random_bits, trigger, cargo);
|
||||||
}
|
}
|
||||||
area.tile += TileDiffXY(1, 0);
|
|
||||||
}
|
}
|
||||||
area.tile += TileDiffXY(-area.w, 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user