summaryrefslogtreecommitdiff
path: root/landscape.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-30 08:25:39 +0000
committertron <tron@openttd.org>2005-01-30 08:25:39 +0000
commitcc7f7220c0f098da69be630a33bad75b6505788b (patch)
tree638c93fb08bd24cac9f9aeb9ca469f21c7e92b67 /landscape.c
parentc16c7312cf37f9bf040e03f87d732bd862afb186 (diff)
downloadopenttd-cc7f7220c0f098da69be630a33bad75b6505788b.tar.xz
(svn r1726) Move an assert() because it could not catch all cases of incorrect input where it was placed
Diffstat (limited to 'landscape.c')
-rw-r--r--landscape.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/landscape.c b/landscape.c
index 1cbb39983..32726a577 100644
--- a/landscape.c
+++ b/landscape.c
@@ -46,14 +46,14 @@ uint GetTileSlope(uint tile, int *h)
uint a,b,c,d,min;
int r;
+ assert(tile < MapSize());
+
if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) {
if (h)
*h = 0;
return 0;
}
- assert(tile < MapSize() && TileX(tile) != MapMaxX() && TileY(tile) != MapMaxY());
-
min = a = TileHeight(tile);
b = TileHeight(tile + TILE_XY(1,0));
if (min >= b) min = b;