summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2008-03-08 18:32:01 +0000
committerglx <glx@openttd.org>2008-03-08 18:32:01 +0000
commit220b2a1ae1c020132eff593f4df796c04d8c3b72 (patch)
treeaaf034217d97f1e9c8560ae28d63cc8013df0c57
parent82e340c3257672fb3a3f0b833e231dd60850757c (diff)
downloadopenttd-220b2a1ae1c020132eff593f4df796c04d8c3b72.tar.xz
(svn r12350) -Fix [FS#1836](r11947): do not try ti flood water tile (performance increase)
-rw-r--r--src/water_cmd.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index e78742de8..e41773e7e 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -912,7 +912,7 @@ static FloodingBehaviour GetFloodingBehaviour(TileIndex tile)
*/
static void DoFloodTile(TileIndex target)
{
- if (IsTileType(target, MP_WATER)) return;
+ assert(!IsTileType(target, MP_WATER));
bool flooded = false; // Will be set to true if something is changed.
@@ -1033,6 +1033,8 @@ void TileLoop_Water(TileIndex tile)
for (Direction dir = DIR_BEGIN; dir < DIR_END; dir++) {
TileIndex dest = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir(dir));
if (dest == INVALID_TILE) continue;
+ /* do not try to flood water tiles - increases performance a lot */
+ if (IsTileType(dest, MP_WATER)) continue;
uint z_dest;
Slope slope_dest = (Slope)(GetFoundationSlope(dest, &z_dest) & ~SLOPE_HALFTILE_MASK & ~SLOPE_STEEP);