Codechange: Remove FOR_EACH_SET_BIT

This commit is contained in:
glx22
2021-06-13 04:18:21 +02:00
committed by Loïc Guilloux
parent 5844027eb8
commit 89ab8b79a5
9 changed files with 58 additions and 32 deletions

View File

@@ -1246,8 +1246,7 @@ void TileLoop_Water(TileIndex tile)
case FLOOD_DRYUP: {
Slope slope_here = GetFoundationSlope(tile) & ~SLOPE_HALFTILE_MASK & ~SLOPE_STEEP;
uint dir;
FOR_EACH_SET_BIT(dir, _flood_from_dirs[slope_here]) {
for (uint dir : SetBitIterator(_flood_from_dirs[slope_here])) {
TileIndex dest = tile + TileOffsByDir((Direction)dir);
if (!IsValidTile(dest)) continue;
@@ -1285,8 +1284,7 @@ void ConvertGroundTilesIntoWaterTiles()
break;
default:
uint dir;
FOR_EACH_SET_BIT(dir, _flood_from_dirs[slope & ~SLOPE_STEEP]) {
for (uint dir : SetBitIterator(_flood_from_dirs[slope & ~SLOPE_STEEP])) {
TileIndex dest = TileAddByDir(tile, (Direction)dir);
Slope slope_dest = GetTileSlope(dest) & ~SLOPE_STEEP;
if (slope_dest == SLOPE_FLAT || IsSlopeWithOneCornerRaised(slope_dest)) {