mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Use template parameter of SetBitIterator instead of casting later. (#13015)
This removes some manual casting.pull/13016/head
parent
6ca9ddcffa
commit
3eb7901ad9
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue