summaryrefslogtreecommitdiff
path: root/landscape.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-05-07 07:55:05 +0000
committertron <tron@openttd.org>2006-05-07 07:55:05 +0000
commit5622ad4b5efdba60db4bcfaf03ba358c569064f6 (patch)
treef5113d4060c886372d1bca9edc9098d07a6dc3e0 /landscape.c
parent4f092c8de8e30ce4d29165a7d46dd2203c887722 (diff)
downloadopenttd-5622ad4b5efdba60db4bcfaf03ba358c569064f6.tar.xz
(svn r4765) Add GetTileMaxZ(), which returns the height of the highest corner of a tile, and use it to simplify the code in a few places
Diffstat (limited to 'landscape.c')
-rw-r--r--landscape.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/landscape.c b/landscape.c
index 53c72dfaf..cc044eab2 100644
--- a/landscape.c
+++ b/landscape.c
@@ -396,10 +396,9 @@ void InitializeLandscape(void)
void ConvertGroundTilesIntoWaterTiles(void)
{
TileIndex tile = 0;
- uint h;
for (tile = 0; tile < MapSize(); ++tile) {
- if (IsTileType(tile, MP_CLEAR) && GetTileSlope(tile, &h) == SLOPE_FLAT && h == 0) {
+ if (IsTileType(tile, MP_CLEAR) && GetTileMaxZ(tile) == 0) {
MakeWater(tile);
}
}