From 3eb7901ad94349ce2115abad9140345221380450 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Mon, 21 Oct 2024 17:54:54 +0100 Subject: [PATCH] Codechange: Use template parameter of SetBitIterator instead of casting later. (#13015) This removes some manual casting. --- src/water_cmd.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 9d7dc389a8..24d3f4186f 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -1255,8 +1255,8 @@ void TileLoop_Water(TileIndex tile) case FLOOD_DRYUP: { Slope slope_here = std::get<0>(GetFoundationSlope(tile)) & ~SLOPE_HALFTILE_MASK & ~SLOPE_STEEP; - for (uint dir : SetBitIterator(_flood_from_dirs[slope_here])) { - TileIndex dest = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir(static_cast(dir))); + for (Direction dir : SetBitIterator(_flood_from_dirs[slope_here])) { + TileIndex dest = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir(dir)); /* Contrary to flooding, drying up does consider MP_VOID tiles. */ if (dest == INVALID_TILE) continue; @@ -1292,8 +1292,8 @@ void ConvertGroundTilesIntoWaterTiles() break; default: - for (uint dir : SetBitIterator(_flood_from_dirs[slope & ~SLOPE_STEEP])) { - TileIndex dest = TileAddByDir(tile, (Direction)dir); + for (Direction dir : SetBitIterator(_flood_from_dirs[slope & ~SLOPE_STEEP])) { + TileIndex dest = TileAddByDir(tile, dir); Slope slope_dest = GetTileSlope(dest) & ~SLOPE_STEEP; if (slope_dest == SLOPE_FLAT || IsSlopeWithOneCornerRaised(slope_dest) || IsTileType(dest, MP_VOID)) { MakeShore(tile);