# HG changeset patch # User KUDr # Date 1167738077 0 # Node ID 58d96074685eb7e0c232e3b3407f91a29ce859c8 # Parent 3a01b04b9a8e69c823d642269dcfd51333bad77f (svn r7744) [cbh] - Fix: signal update didn't work when new tunnel built (peter1138) diff -r 3a01b04b9a8e -r 58d96074685e pathfind.c --- a/pathfind.c Tue Jan 02 10:12:36 2007 +0000 +++ b/pathfind.c Tue Jan 02 11:41:17 2007 +0000 @@ -258,16 +258,15 @@ RememberData rd; TileIndex tile_org = tile; bool is_bridge = false; + bool is_tunnel = false; - if (IsTileType(tile, MP_TUNNEL)) { - if (GetTunnelDirection(tile) != direction || - GetTunnelTransportType(tile) != tpf->tracktype) { + if (IsTileType(tile, MP_TUNNEL) && GetTunnelDirection(tile) == direction) { + if (GetTunnelTransportType(tile) != tpf->tracktype) { return; } tile = SkipToEndOfTunnel(tpf, tile, direction); - } - - if ((IsTileType(tile, MP_STREET_BRIDGE) || IsTileType(tile, MP_RAILWAY_BRIDGE)) && GetBridgeRampDirection(tile) == direction) { + is_tunnel = true; + } else if ((IsTileType(tile, MP_STREET_BRIDGE) || IsTileType(tile, MP_RAILWAY_BRIDGE)) && GetBridgeRampDirection(tile) == direction) { TileIndex tile_end; if (GetBridgeTransportType(tile) != tpf->tracktype) { return; @@ -306,7 +305,7 @@ /* Check if the new tile is a tunnel or bridge head and that the direction * and transport type match */ if (IsTunnelTile(tile)) { - if (GetTunnelDirection(tile) != direction || + if ((!is_tunnel && GetTunnelDirection(tile) != direction) || GetTunnelTransportType(tile) != tpf->tracktype) { return; }