mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r3194) Don't use FindLandscapeHeightByTile() when it's overkill
This commit is contained in:
parent
62b2b4613f
commit
1806293e46
12
main_gui.c
12
main_gui.c
@ -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);
|
||||||
|
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user