From 4a359a4aed48df419892a7d6846ac58b5e6f3b3b Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sat, 19 Oct 2024 23:04:08 +0200 Subject: [PATCH] Fix 8ca417b: drying of (edge) tiles should consider MP_VOID tiles --- src/water_cmd.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 0648ecef3c..c86976397a 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -1236,6 +1236,7 @@ void TileLoop_Water(TileIndex tile) case FLOOD_ACTIVE: for (Direction dir = DIR_BEGIN; dir < DIR_END; dir++) { TileIndex dest = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir(dir)); + /* Contrary to drying up, flooding does not consider MP_VOID tiles. */ if (!IsValidTile(dest)) continue; /* do not try to flood water tiles - increases performance a lot */ 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; for (uint dir : SetBitIterator(_flood_from_dirs[slope_here])) { TileIndex dest = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir(static_cast(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); if ((dest_behaviour == FLOOD_ACTIVE) || (dest_behaviour == FLOOD_PASSIVE)) return;