diff options
author | tron <tron@openttd.org> | 2005-02-07 10:41:45 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-02-07 10:41:45 +0000 |
commit | f8d97a5f616c5e303b2822316fcef409baee6195 (patch) | |
tree | 6fb9696d4610ea19244f194d0c47fa748af72fd4 /tunnelbridge_cmd.c | |
parent | ad837c2069d37ad36dfba07f62bd35a6694dd266 (diff) | |
download | openttd-f8d97a5f616c5e303b2822316fcef409baee6195.tar.xz |
(svn r1839) Move GetTileSlope() and GetTileZ() into tile.[ch] and use more explicit types as parameters
Diffstat (limited to 'tunnelbridge_cmd.c')
-rw-r--r-- | tunnelbridge_cmd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c index a42640deb..95cc74dc7 100644 --- a/tunnelbridge_cmd.c +++ b/tunnelbridge_cmd.c @@ -586,7 +586,7 @@ static const byte _updsignals_tunnel_dir[4] = { 5, 7, 1, 3}; uint CheckTunnelBusy(uint tile, int *length) { - int z = GetTileZ(tile); + uint z = GetTileZ(tile); byte m5 = _map5[tile]; int delta = TileOffsByDir(m5 & 3); int len = 0; @@ -1404,7 +1404,6 @@ static uint32 VehicleEnter_TunnelBridge(Vehicle *v, uint tile, int x, int y) int z; int dir, vdir; byte fc; - int h; if ((_map5[tile] & 0xF0) == 0) { z = GetSlopeZ(x, y) - v->z_pos; @@ -1472,6 +1471,8 @@ static uint32 VehicleEnter_TunnelBridge(Vehicle *v, uint tile, int x, int y) } } else if (_map5[tile] & 0x80) { if (v->type == VEH_Road || (v->type == VEH_Train && v->subtype == TS_Front_Engine)) { + uint h; + if (GetTileSlope(tile, &h) != 0) h += 8; // Compensate for possible foundation if (!(_map5[tile] & 0x40) || // start/end tile of bridge |