summaryrefslogtreecommitdiff
path: root/tile.c
diff options
context:
space:
mode:
Diffstat (limited to 'tile.c')
-rw-r--r--tile.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tile.c b/tile.c
index 36df4c542..98fb5f0bd 100644
--- a/tile.c
+++ b/tile.c
@@ -56,3 +56,20 @@ uint GetTileZ(TileIndex tile)
GetTileSlope(tile, &h);
return h;
}
+
+
+uint GetTileMaxZ(TileIndex t)
+{
+ uint max;
+ uint h;
+
+ h = TileHeight(t);
+ max = h;
+ h = TileHeight(t + TileDiffXY(1, 0));
+ if (h > max) max = h;
+ h = TileHeight(t + TileDiffXY(0, 1));
+ if (h > max) max = h;
+ h = TileHeight(t + TileDiffXY(1, 1));
+ if (h > max) max = h;
+ return max * 8;
+}