From bf703a0e825c16d07cf64f62ace41ff8b9bd69c0 Mon Sep 17 00:00:00 2001 From: darkvater Date: Tue, 14 Sep 2004 01:21:07 +0000 Subject: (svn r242) -Fix: Pathfinding bug for road vehicles introduced in r160 fixed (blathijs) -Fix: Pathfinding under bridges bug for ships introduced in r160 fixed (Darkvater) --- pathfind.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'pathfind.c') diff --git a/pathfind.c b/pathfind.c index 9a566a273..e5f099ef8 100644 --- a/pathfind.c +++ b/pathfind.c @@ -212,10 +212,9 @@ FindLengthOfTunnelResult FindLengthOfTunnel(uint tile, int direction) tile = TILE_FROM_XY(x,y); if (IS_TILETYPE(tile, MP_TUNNELBRIDGE) && - (_map5[tile] & 0xF0) == 0 && - //((_map5[tile]>>2)&3) == type && // This is - //not necesary to check, right? - ((_map5[tile] & 3)^2) == direction && + (_map5[tile] & 0xF0) == 0 && // tunnel entrance/exit + //((_map5[tile]>>2)&3) == type && // rail/road-tunnel <-- This is not necesary to check, right? + ((_map5[tile] & 3)^2) == direction && // entrance towards: 0 = NE, 1 = SE, 2 = SW, 3 = NW GetSlopeZ(x+8, y+8) == z) break; } @@ -263,7 +262,7 @@ void TPFMode1(TrackPathFinder *tpf, uint tile, int direction) uint tile_org = tile; if (IS_TILETYPE(tile, MP_TUNNELBRIDGE) && (_map5[tile] & 0xF0)==0) { - if ((_map5[tile] & 3) != direction || ((_map5[tile]>>1)&6) != tpf->tracktype) + if ((_map5[tile] & 3) != direction || ((_map5[tile]>>2)&3) != tpf->tracktype) return; tile = SkipToEndOfTunnel(tpf, tile, direction); } -- cgit v1.2.3-54-g00ecf