From 1806293e465800e056ba78b6ffc5de80a0161afb Mon Sep 17 00:00:00 2001 From: tron Date: Wed, 16 Nov 2005 11:52:21 +0000 Subject: (svn r3194) Don't use FindLandscapeHeightByTile() when it's overkill --- main_gui.c | 12 ++++-------- water_cmd.c | 7 ++++--- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/main_gui.c b/main_gui.c index cac653495..c3c8277ad 100644 --- a/main_gui.c +++ b/main_gui.c @@ -1200,11 +1200,9 @@ static void PlaceProc_RockyArea(TileIndex tile) static void PlaceProc_LightHouse(TileIndex tile) { - TileInfo ti; - - FindLandscapeHeightByTile(&ti, tile); - if (!IsTileType(tile, MP_CLEAR) || IsSteepTileh(ti.tileh)) + if (!IsTileType(tile, MP_CLEAR) || IsSteepTileh(GetTileSlope(tile, NULL))) { return; + } ModifyTile(tile, MP_SETTYPE(MP_UNMOVABLE) | MP_MAP5, 1); SndPlayTileFx(SND_1F_SPLAT, tile); @@ -1212,11 +1210,9 @@ static void PlaceProc_LightHouse(TileIndex tile) static void PlaceProc_Transmitter(TileIndex tile) { - TileInfo ti; - - FindLandscapeHeightByTile(&ti, tile); - if (!IsTileType(tile, MP_CLEAR) || IsSteepTileh(ti.tileh)) + if (!IsTileType(tile, MP_CLEAR) || IsSteepTileh(GetTileSlope(tile, NULL))) { return; + } ModifyTile(tile, MP_SETTYPE(MP_UNMOVABLE) | MP_MAP5, 0); SndPlayTileFx(SND_1F_SPLAT, tile); diff --git a/water_cmd.c b/water_cmd.c index 3a5c3924e..fcfa4211b 100644 --- a/water_cmd.c +++ b/water_cmd.c @@ -39,9 +39,10 @@ static void FloodVehicle(Vehicle *v); static bool IsClearWaterTile(TileIndex tile) { - TileInfo ti; - FindLandscapeHeightByTile(&ti, tile); - return (ti.type == MP_WATER && ti.tileh == 0 && ti.map5 == 0); + return + IsTileType(tile, MP_WATER) && + _m[tile].m5 == 0 && + GetTileSlope(tile, NULL) == 0; } /** Build a ship depot. -- cgit v1.2.3-70-g09d2