diff options
author | tron <tron@openttd.org> | 2006-06-14 09:01:21 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-06-14 09:01:21 +0000 |
commit | f5638395fe8b48028fcc58337d58b6d1e9798fc4 (patch) | |
tree | 3a0c45a0febca0e1f2078103ebccb907ecd52fd6 /tunnelbridge_cmd.c | |
parent | b6e2b38fe76034fa900b914f11f2db4f0af1dc8b (diff) | |
download | openttd-f5638395fe8b48028fcc58337d58b6d1e9798fc4.tar.xz |
(svn r5259) -Codechange: GetBridgeHeight{Ramp,}() now returns the height of the bridge, not one level lower
Diffstat (limited to 'tunnelbridge_cmd.c')
-rw-r--r-- | tunnelbridge_cmd.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c index 4bd014fe9..2437915e0 100644 --- a/tunnelbridge_cmd.c +++ b/tunnelbridge_cmd.c @@ -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]; |