(svn r3194) Don't use FindLandscapeHeightByTile() when it's overkill

This commit is contained in:
tron 2005-11-16 11:52:21 +00:00
parent 62b2b4613f
commit 1806293e46
2 changed files with 8 additions and 11 deletions

View File

@ -1200,11 +1200,9 @@ static void PlaceProc_RockyArea(TileIndex tile)
static void PlaceProc_LightHouse(TileIndex tile) static void PlaceProc_LightHouse(TileIndex tile)
{ {
TileInfo ti; if (!IsTileType(tile, MP_CLEAR) || IsSteepTileh(GetTileSlope(tile, NULL))) {
FindLandscapeHeightByTile(&ti, tile);
if (!IsTileType(tile, MP_CLEAR) || IsSteepTileh(ti.tileh))
return; return;
}
ModifyTile(tile, MP_SETTYPE(MP_UNMOVABLE) | MP_MAP5, 1); ModifyTile(tile, MP_SETTYPE(MP_UNMOVABLE) | MP_MAP5, 1);
SndPlayTileFx(SND_1F_SPLAT, tile); SndPlayTileFx(SND_1F_SPLAT, tile);
@ -1212,11 +1210,9 @@ static void PlaceProc_LightHouse(TileIndex tile)
static void PlaceProc_Transmitter(TileIndex tile) static void PlaceProc_Transmitter(TileIndex tile)
{ {
TileInfo ti; if (!IsTileType(tile, MP_CLEAR) || IsSteepTileh(GetTileSlope(tile, NULL))) {
FindLandscapeHeightByTile(&ti, tile);
if (!IsTileType(tile, MP_CLEAR) || IsSteepTileh(ti.tileh))
return; return;
}
ModifyTile(tile, MP_SETTYPE(MP_UNMOVABLE) | MP_MAP5, 0); ModifyTile(tile, MP_SETTYPE(MP_UNMOVABLE) | MP_MAP5, 0);
SndPlayTileFx(SND_1F_SPLAT, tile); SndPlayTileFx(SND_1F_SPLAT, tile);

View File

@ -39,9 +39,10 @@ static void FloodVehicle(Vehicle *v);
static bool IsClearWaterTile(TileIndex tile) static bool IsClearWaterTile(TileIndex tile)
{ {
TileInfo ti; return
FindLandscapeHeightByTile(&ti, tile); IsTileType(tile, MP_WATER) &&
return (ti.type == MP_WATER && ti.tileh == 0 && ti.map5 == 0); _m[tile].m5 == 0 &&
GetTileSlope(tile, NULL) == 0;
} }
/** Build a ship depot. /** Build a ship depot.