1
0
Fork 0

Codechange: Use template parameter of SetBitIterator instead of casting later.

This removes some manual casting.
pull/13015/head
Peter Nelson 2024-10-21 17:21:53 +01:00
parent 6ca9ddcffa
commit b228a11b2a
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
1 changed files with 4 additions and 4 deletions

View File

@ -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<Direction>(dir)));
for (Direction dir : SetBitIterator<Direction>(_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<Direction>(_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);