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

@@ -329,7 +329,7 @@ bool FindSubsidyTownCargoRoute()
/* Calculate the produced cargo of houses around town center. */
CargoArray town_cargo_produced;
TileArea ta = TileArea(src_town->xy, 1, 1).Expand(SUBSIDY_TOWN_CARGO_RADIUS);
TILE_AREA_LOOP(tile, ta) {
for (TileIndex tile : ta) {
if (IsTileType(tile, MP_HOUSE)) {
AddProducedCargo(tile, town_cargo_produced);
}
@@ -440,7 +440,7 @@ bool FindSubsidyCargoDestination(CargoID cid, SourceType src_type, SourceID src)
/* Calculate cargo acceptance of houses around town center. */
CargoArray town_cargo_accepted;
TileArea ta = TileArea(dst_town->xy, 1, 1).Expand(SUBSIDY_TOWN_CARGO_RADIUS);
TILE_AREA_LOOP(tile, ta) {
for (TileIndex tile : ta) {
if (IsTileType(tile, MP_HOUSE)) {
AddAcceptedCargo(tile, town_cargo_accepted, nullptr);
}