diff options
author | rubidium <rubidium@openttd.org> | 2011-11-04 10:25:33 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-11-04 10:25:33 +0000 |
commit | b167c0a3967a62b4cbe98a12f2c4d932ee8df510 (patch) | |
tree | 59ae32bc087b05c1d2c3e990706f3efed22d8d93 /src/ai/api/ai_tile.cpp | |
parent | ecbc56a67711bfc37d751f9c3bff2a464ea03564 (diff) | |
download | openttd-b167c0a3967a62b4cbe98a12f2c4d932ee8df510.tar.xz |
(svn r23095) -Codechange: remove useless divisions/multiplications by TILE_HEIGHT for the AI API code
Diffstat (limited to 'src/ai/api/ai_tile.cpp')
-rw-r--r-- | src/ai/api/ai_tile.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ai/api/ai_tile.cpp b/src/ai/api/ai_tile.cpp index bda19775b..677c845a3 100644 --- a/src/ai/api/ai_tile.cpp +++ b/src/ai/api/ai_tile.cpp @@ -156,14 +156,14 @@ { if (!::IsValidTile(tile)) return -1; - return ::GetTilePixelZ(tile) / ::TILE_HEIGHT; + return ::GetTileZ(tile); } /* static */ int32 AITile::GetMaxHeight(TileIndex tile) { if (!::IsValidTile(tile)) return -1; - return ::GetTileMaxPixelZ(tile) / ::TILE_HEIGHT; + return ::GetTileMaxZ(tile); } /* static */ int32 AITile::GetCornerHeight(TileIndex tile, Corner corner) @@ -171,8 +171,8 @@ if (!::IsValidTile(tile) || !::IsValidCorner((::Corner)corner)) return -1; uint z; - ::Slope slope = ::GetTilePixelSlope(tile, &z); - return (z + ::GetSlopePixelZInCorner(slope, (::Corner)corner)) / ::TILE_HEIGHT; + ::Slope slope = ::GetTileSlope(tile, &z); + return (z + ::GetSlopeZInCorner(slope, (::Corner)corner)); } /* static */ AICompany::CompanyID AITile::GetOwner(TileIndex tile) |