(svn r4765) Add GetTileMaxZ(), which returns the height of the highest corner of a tile, and use it to simplify the code in a few places

This commit is contained in:
tron
2006-05-07 07:55:05 +00:00
parent ec7e431cf6
commit ebcf2ee3b1
6 changed files with 26 additions and 20 deletions

View File

@@ -396,10 +396,9 @@ void InitializeLandscape(void)
void ConvertGroundTilesIntoWaterTiles(void)
{
TileIndex tile = 0;
uint h;
for (tile = 0; tile < MapSize(); ++tile) {
if (IsTileType(tile, MP_CLEAR) && GetTileSlope(tile, &h) == SLOPE_FLAT && h == 0) {
if (IsTileType(tile, MP_CLEAR) && GetTileMaxZ(tile) == 0) {
MakeWater(tile);
}
}