diff options
author | glx22 <glx@openttd.org> | 2021-05-12 16:45:28 +0200 |
---|---|---|
committer | Loïc Guilloux <glx22@users.noreply.github.com> | 2021-05-13 00:13:54 +0200 |
commit | 38c97e14926f4bc538c20b24f8a3decdef1668f9 (patch) | |
tree | 2138fa9979f463c5b946653c23313fbb977be652 /src/terraform_gui.cpp | |
parent | 5bd81448539b63519d70ba85d4833e446f0597fe (diff) | |
download | openttd-38c97e14926f4bc538c20b24f8a3decdef1668f9.tar.xz |
Codechange: Replace TILE_AREA_LOOP with range-based for loops
Diffstat (limited to 'src/terraform_gui.cpp')
-rw-r--r-- | src/terraform_gui.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 84cd2eca8..0e1896a44 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -57,7 +57,7 @@ static void GenerateDesertArea(TileIndex end, TileIndex start) _generating_world = true; TileArea ta(start, end); - TILE_AREA_LOOP(tile, ta) { + for (TileIndex tile : ta) { SetTropicZone(tile, (_ctrl_pressed) ? TROPICZONE_NORMAL : TROPICZONE_DESERT); DoCommandP(tile, 0, 0, CMD_LANDSCAPE_CLEAR); MarkTileDirtyByTile(tile); @@ -74,7 +74,7 @@ static void GenerateRockyArea(TileIndex end, TileIndex start) bool success = false; TileArea ta(start, end); - TILE_AREA_LOOP(tile, ta) { + for (TileIndex tile : ta) { switch (GetTileType(tile)) { case MP_TREES: if (GetTreeGround(tile) == TREE_GROUND_SHORE) continue; @@ -408,18 +408,18 @@ static void CommonRaiseLowerBigLand(TileIndex tile, int mode) if (mode != 0) { /* Raise land */ h = MAX_TILE_HEIGHT; - TILE_AREA_LOOP(tile2, ta) { + for (TileIndex tile2 : ta) { h = std::min(h, TileHeight(tile2)); } } else { /* Lower land */ h = 0; - TILE_AREA_LOOP(tile2, ta) { + for (TileIndex tile2 : ta) { h = std::max(h, TileHeight(tile2)); } } - TILE_AREA_LOOP(tile2, ta) { + for (TileIndex tile2 : ta) { if (TileHeight(tile2) == h) { DoCommandP(tile2, SLOPE_N, (uint32)mode, CMD_TERRAFORM_LAND); } |