mirror of https://github.com/OpenTTD/OpenTTD
Fix 8ca417b: drying of (edge) tiles should consider MP_VOID tiles
parent
147ac56f11
commit
4a359a4aed
|
@ -1236,6 +1236,7 @@ void TileLoop_Water(TileIndex tile)
|
||||||
case FLOOD_ACTIVE:
|
case FLOOD_ACTIVE:
|
||||||
for (Direction dir = DIR_BEGIN; dir < DIR_END; dir++) {
|
for (Direction dir = DIR_BEGIN; dir < DIR_END; dir++) {
|
||||||
TileIndex dest = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir(dir));
|
TileIndex dest = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir(dir));
|
||||||
|
/* Contrary to drying up, flooding does not consider MP_VOID tiles. */
|
||||||
if (!IsValidTile(dest)) continue;
|
if (!IsValidTile(dest)) continue;
|
||||||
/* do not try to flood water tiles - increases performance a lot */
|
/* do not try to flood water tiles - increases performance a lot */
|
||||||
if (IsTileType(dest, MP_WATER)) continue;
|
if (IsTileType(dest, MP_WATER)) continue;
|
||||||
|
@ -1256,7 +1257,8 @@ void TileLoop_Water(TileIndex tile)
|
||||||
Slope slope_here = std::get<0>(GetFoundationSlope(tile)) & ~SLOPE_HALFTILE_MASK & ~SLOPE_STEEP;
|
Slope slope_here = std::get<0>(GetFoundationSlope(tile)) & ~SLOPE_HALFTILE_MASK & ~SLOPE_STEEP;
|
||||||
for (uint dir : SetBitIterator(_flood_from_dirs[slope_here])) {
|
for (uint dir : SetBitIterator(_flood_from_dirs[slope_here])) {
|
||||||
TileIndex dest = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir(static_cast<Direction>(dir)));
|
TileIndex dest = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir(static_cast<Direction>(dir)));
|
||||||
if (!IsValidTile(dest)) continue;
|
/* Contrary to flooding, drying up does consider MP_VOID tiles. */
|
||||||
|
if (dest == INVALID_TILE) continue;
|
||||||
|
|
||||||
FloodingBehaviour dest_behaviour = GetFloodingBehaviour(dest);
|
FloodingBehaviour dest_behaviour = GetFloodingBehaviour(dest);
|
||||||
if ((dest_behaviour == FLOOD_ACTIVE) || (dest_behaviour == FLOOD_PASSIVE)) return;
|
if ((dest_behaviour == FLOOD_ACTIVE) || (dest_behaviour == FLOOD_PASSIVE)) return;
|
||||||
|
|
Loading…
Reference in New Issue