(svn r3644) Don't use FindLandscapeHeightByTile() when it's overkill - often it was just a complicated way of writing GetTileSlope(tile, NULL)

This commit is contained in:
tron
2006-02-21 07:41:54 +00:00
parent 35fb17947a
commit 4b46883751
6 changed files with 83 additions and 86 deletions

View File

@@ -840,10 +840,8 @@ static void AiNew_State_FindDepot(Player *p)
// Is the terrain clear?
if (IsTileType(tile + TileOffsByDir(j), MP_CLEAR) ||
IsTileType(tile + TileOffsByDir(j), MP_TREES)) {
TileInfo ti;
FindLandscapeHeightByTile(&ti, tile);
// If the current tile is on a slope (tileh != 0) then we do not allow this
if (ti.tileh != 0) continue;
if (GetTileSlope(tile, NULL) != 0) continue;
// Check if everything went okay..
r = AiNew_Build_Depot(p, tile + TileOffsByDir(j), j ^ 2, 0);
if (CmdFailed(r)) continue;