1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-18 20:19:11 +00:00

(svn r5259) -Codechange: GetBridgeHeight{Ramp,}() now returns the height of the bridge, not one level lower

This commit is contained in:
tron
2006-06-14 09:01:21 +00:00
parent b6e2b38fe7
commit f5638395fe
2 changed files with 12 additions and 9 deletions

View File

@@ -598,7 +598,10 @@ static uint GetBridgeHeightRamp(TileIndex t)
/* Return the height there (the height of the NORTH CORNER)
* If the end of the bridge is on a tile with all corners except the north corner raised,
* the z coordinate is 1 height level too low. Compensate for that */
return TilePixelHeight(t) + (GetTileSlope(t, NULL) == SLOPE_WSE ? TILE_HEIGHT : 0);
return
TilePixelHeight(t) +
(GetTileSlope(t, NULL) == SLOPE_WSE ? TILE_HEIGHT : 0) +
TILE_HEIGHT;
}
@@ -670,7 +673,7 @@ static int32 DoClearBridge(TileIndex tile, uint32 flags)
v = FindVehicleBetween(
tile + delta,
endtile - delta,
GetBridgeHeightRamp(tile) + TILE_HEIGHT
GetBridgeHeightRamp(tile)
);
if (v != NULL) return_cmd_error(VehicleInTheWayErrMsg(v));
@@ -1040,7 +1043,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti)
// get bridge sprites
b = GetBridgeSpriteTable(GetBridgeType(ti->tile), GetBridgePiece(ti->tile)) + base_offset;
z = GetBridgeHeight(ti->tile) + 5;
z = GetBridgeHeight(ti->tile) - 3;
// draw rail or road component
image = b[0];