1
0
Fork 0

Codechange: Use template parameter of SetBitIterator instead of casting later. (#13015)

This removes some manual casting.
pull/13016/head
Peter Nelson 2024-10-21 17:54:54 +01:00 committed by GitHub
parent 6ca9ddcffa
commit 3eb7901ad9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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);