mirror of https://github.com/OpenTTD/OpenTTD
(svn r1726) Move an assert() because it could not catch all cases of incorrect input where it was placed
parent
c16c7312cf
commit
cc7f7220c0
|
@ -46,14 +46,14 @@ uint GetTileSlope(uint tile, int *h)
|
||||||
uint a,b,c,d,min;
|
uint a,b,c,d,min;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
assert(tile < MapSize());
|
||||||
|
|
||||||
if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) {
|
if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) {
|
||||||
if (h)
|
if (h)
|
||||||
*h = 0;
|
*h = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(tile < MapSize() && TileX(tile) != MapMaxX() && TileY(tile) != MapMaxY());
|
|
||||||
|
|
||||||
min = a = TileHeight(tile);
|
min = a = TileHeight(tile);
|
||||||
b = TileHeight(tile + TILE_XY(1,0));
|
b = TileHeight(tile + TILE_XY(1,0));
|
||||||
if (min >= b) min = b;
|
if (min >= b) min = b;
|
||||||
|
|
Loading…
Reference in New Issue