mirror of https://github.com/OpenTTD/OpenTTD
(svn r1542) Rename TileHeight to TilePixelHeight, because this is what it actually returns
parent
b119b6c474
commit
ef923fae44
2
map.h
2
map.h
|
@ -73,7 +73,7 @@ static inline TileIndexDiff TileOffsByDir(uint dir)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline uint TileHeight(TileIndex tile)
|
static inline uint TilePixelHeight(TileIndex tile)
|
||||||
{
|
{
|
||||||
assert(tile < MapSize());
|
assert(tile < MapSize());
|
||||||
return (_map_type_and_height[tile] & 0xf) * 8;
|
return (_map_type_and_height[tile] & 0xf) * 8;
|
||||||
|
|
|
@ -279,7 +279,7 @@ int32 CmdBuildSingleRail(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
|
|
||||||
if (ti.type == MP_TUNNELBRIDGE) {
|
if (ti.type == MP_TUNNELBRIDGE) {
|
||||||
/* BUILD ON BRIDGE CODE */
|
/* BUILD ON BRIDGE CODE */
|
||||||
if (!EnsureNoVehicleZ(tile, TileHeight(tile)))
|
if (!EnsureNoVehicleZ(tile, TilePixelHeight(tile)))
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
|
|
||||||
if ((ti.map5 & 0xF8) == 0xC0) {
|
if ((ti.map5 & 0xF8) == 0xC0) {
|
||||||
|
@ -438,7 +438,7 @@ int32 CmdRemoveSingleRail(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
|
|
||||||
if (ti.type == MP_TUNNELBRIDGE) {
|
if (ti.type == MP_TUNNELBRIDGE) {
|
||||||
if (!EnsureNoVehicleZ(tile, TileHeight(tile)))
|
if (!EnsureNoVehicleZ(tile, TilePixelHeight(tile)))
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
|
|
||||||
if ((ti.map5 & 0xF8) != 0xE0)
|
if ((ti.map5 & 0xF8) != 0xE0)
|
||||||
|
|
|
@ -164,7 +164,7 @@ int32 CmdRemoveRoad(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ti.type == MP_TUNNELBRIDGE) {
|
if (ti.type == MP_TUNNELBRIDGE) {
|
||||||
if (!EnsureNoVehicleZ(tile, TileHeight(tile)))
|
if (!EnsureNoVehicleZ(tile, TilePixelHeight(tile)))
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
|
|
||||||
if ((ti.map5 & 0xE9) == 0xE8) {
|
if ((ti.map5 & 0xE9) == 0xE8) {
|
||||||
|
|
|
@ -1656,7 +1656,7 @@ static void UpdateTownGrowRate(Town *t)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_opt.landscape == LT_HILLY) {
|
if (_opt.landscape == LT_HILLY) {
|
||||||
if (TileHeight(t->xy) >= _opt.snow_line && t->act_food == 0 && t->population > 90)
|
if (TilePixelHeight(t->xy) >= _opt.snow_line && t->act_food == 0 && t->population > 90)
|
||||||
return;
|
return;
|
||||||
} else if (_opt.landscape == LT_DESERT) {
|
} else if (_opt.landscape == LT_DESERT) {
|
||||||
if (GetMapExtraBits(t->xy) == 1 && (t->act_food==0 || t->act_water==0) && t->population > 60)
|
if (GetMapExtraBits(t->xy) == 1 && (t->act_food==0 || t->act_water==0) && t->population > 60)
|
||||||
|
|
|
@ -698,7 +698,7 @@ static int32 DoClearBridge(uint tile, uint32 flags)
|
||||||
int32 cost;
|
int32 cost;
|
||||||
|
|
||||||
// check if we own the tile below the bridge..
|
// check if we own the tile below the bridge..
|
||||||
if (_current_player != OWNER_WATER && (!CheckTileOwnership(tile) || !EnsureNoVehicleZ(tile, TileHeight(tile))))
|
if (_current_player != OWNER_WATER && (!CheckTileOwnership(tile) || !EnsureNoVehicleZ(tile, TilePixelHeight(tile))))
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
|
|
||||||
cost = (_map5[tile] & 8) ? _price.remove_road * 2 : _price.remove_rail;
|
cost = (_map5[tile] & 8) ? _price.remove_road * 2 : _price.remove_rail;
|
||||||
|
@ -711,11 +711,11 @@ static int32 DoClearBridge(uint tile, uint32 flags)
|
||||||
return cost;
|
return cost;
|
||||||
|
|
||||||
/* delete canal under bridge */
|
/* delete canal under bridge */
|
||||||
} else if(_map5[tile] == 0xC8 && TileHeight(tile) != 0) {
|
} else if(_map5[tile] == 0xC8 && TilePixelHeight(tile) != 0) {
|
||||||
int32 cost;
|
int32 cost;
|
||||||
|
|
||||||
// check for vehicles under bridge
|
// check for vehicles under bridge
|
||||||
if (!EnsureNoVehicleZ(tile, TileHeight(tile)))
|
if (!EnsureNoVehicleZ(tile, TilePixelHeight(tile)))
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
cost = _price.clear_water;
|
cost = _price.clear_water;
|
||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
|
@ -743,7 +743,7 @@ static int32 DoClearBridge(uint tile, uint32 flags)
|
||||||
*/
|
*/
|
||||||
tile += direction ? TILE_XY(0, 1) : TILE_XY( 1,0);
|
tile += direction ? TILE_XY(0, 1) : TILE_XY( 1,0);
|
||||||
endtile -= direction ? TILE_XY(0, 1) : TILE_XY( 1,0);
|
endtile -= direction ? TILE_XY(0, 1) : TILE_XY( 1,0);
|
||||||
if ((v = FindVehicleBetween(tile, endtile, TileHeight(tile) + 8)) != NULL) {
|
if ((v = FindVehicleBetween(tile, endtile, TilePixelHeight(tile) + 8)) != NULL) {
|
||||||
VehicleInTheWayErrMsg(v);
|
VehicleInTheWayErrMsg(v);
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -852,7 +852,7 @@ int32 DoConvertTunnelBridgeRail(uint tile, uint totype, bool exec)
|
||||||
} else if ((_map5[tile] & 0xF8) == 0xE0) {
|
} else if ((_map5[tile] & 0xF8) == 0xE0) {
|
||||||
// bridge middle part with rail below
|
// bridge middle part with rail below
|
||||||
// only check for train under bridge
|
// only check for train under bridge
|
||||||
if (!CheckTileOwnership(tile) || !EnsureNoVehicleZ(tile, TileHeight(tile)))
|
if (!CheckTileOwnership(tile) || !EnsureNoVehicleZ(tile, TilePixelHeight(tile)))
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
|
|
||||||
// tile is already of requested type?
|
// tile is already of requested type?
|
||||||
|
@ -920,7 +920,7 @@ uint GetBridgeHeight(const TileInfo *ti)
|
||||||
z_correction += 8;
|
z_correction += 8;
|
||||||
|
|
||||||
// return the height there (the height of the NORTH CORNER)
|
// return the height there (the height of the NORTH CORNER)
|
||||||
return TileHeight(tile) + z_correction;
|
return TilePixelHeight(tile) + z_correction;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const byte _bridge_foundations[2][16] = {
|
static const byte _bridge_foundations[2][16] = {
|
||||||
|
|
|
@ -459,7 +459,7 @@ static void GetAcceptedCargo_Water(uint tile, AcceptedCargo ac)
|
||||||
|
|
||||||
static void GetTileDesc_Water(uint tile, TileDesc *td)
|
static void GetTileDesc_Water(uint tile, TileDesc *td)
|
||||||
{
|
{
|
||||||
if (_map5[tile] == 0 && TileHeight(tile) == 0)
|
if (_map5[tile] == 0 && TilePixelHeight(tile) == 0)
|
||||||
td->str = STR_3804_WATER;
|
td->str = STR_3804_WATER;
|
||||||
else if (_map5[tile] == 0)
|
else if (_map5[tile] == 0)
|
||||||
td->str = STR_LANDINFO_CANAL;
|
td->str = STR_LANDINFO_CANAL;
|
||||||
|
|
Loading…
Reference in New Issue