diff --git a/landscape.c b/landscape.c index 1cbb399832..32726a577d 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;