summaryrefslogtreecommitdiff
path: root/src/water_cmd.cpp
diff options
context:
space:
mode:
authorplanetmaker <planetmaker@openttd.org>2014-02-16 17:03:58 +0000
committerplanetmaker <planetmaker@openttd.org>2014-02-16 17:03:58 +0000
commit40f61eaf15b17a5f56d12734f1ae421eff4a23ed (patch)
treeb9f2c168fbcf5500505dfa9ef33257b28270dfb8 /src/water_cmd.cpp
parent46590e112e6c8f11ccdc22cdd5055151c9b03e09 (diff)
downloadopenttd-40f61eaf15b17a5f56d12734f1ae421eff4a23ed.tar.xz
(svn r26344) -Change [FS#5907]: Do not flood shores of type MP_TREE needlessly (MJP)
Diffstat (limited to 'src/water_cmd.cpp')
-rw-r--r--src/water_cmd.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index 263731937..15c57afd5 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -1165,6 +1165,9 @@ void TileLoop_Water(TileIndex tile)
/* do not try to flood water tiles - increases performance a lot */
if (IsTileType(dest, MP_WATER)) continue;
+ /* TREE_GROUND_SHORE is the sign of a previous flood. */
+ if (IsTileType(dest, MP_TREES) && GetTreeGround(dest) == TREE_GROUND_SHORE) continue;
+
int z_dest;
Slope slope_dest = GetFoundationSlope(dest, &z_dest) & ~SLOPE_HALFTILE_MASK & ~SLOPE_STEEP;
if (z_dest > 0) continue;