Codechange: Replace TILE_AREA_LOOP with range-based for loops

This commit is contained in:
glx22
2021-05-12 16:45:28 +02:00
committed by Loïc Guilloux
parent 5bd8144853
commit 38c97e1492
23 changed files with 101 additions and 76 deletions

View File

@@ -737,7 +737,7 @@ void DeallocateSpecFromStation(BaseStation *st, byte specindex)
ETileArea area = ETileArea(st, INVALID_TILE, TA_WHOLE);
/* Check all tiles over the station to check if the specindex is still in use */
TILE_AREA_LOOP(tile, area) {
for (TileIndex tile : area) {
if (st->TileBelongsToRailStation(tile) && GetCustomStationSpecIndex(tile) == specindex) {
return;
}
@@ -939,7 +939,7 @@ void TriggerStationAnimation(BaseStation *st, TileIndex tile, StationAnimationTr
ETileArea area = ETileArea(st, tile, tas[trigger]);
/* Check all tiles over the station to check if the specindex is still in use */
TILE_AREA_LOOP(tile, area) {
for (TileIndex tile : area) {
if (st->TileBelongsToRailStation(tile)) {
const StationSpec *ss = GetStationSpec(tile);
if (ss != nullptr && HasBit(ss->animation.triggers, trigger)) {
@@ -995,7 +995,7 @@ void TriggerStationRandomisation(Station *st, TileIndex tile, StationRandomTrigg
uint32 used_triggers = 0;
/* Check all tiles over the station to check if the specindex is still in use */
TILE_AREA_LOOP(tile, area) {
for (TileIndex tile : area) {
if (st->TileBelongsToRailStation(tile)) {
const StationSpec *ss = GetStationSpec(tile);
if (ss == nullptr) continue;