From 9b9bca40b94fe7e44887004d28efc6b175005e1d Mon Sep 17 00:00:00 2001 From: peter1138 Date: Mon, 30 Jul 2007 08:49:41 +0000 Subject: (svn r10734) -Fix [FS#1030]: Revert r10513) and add special cases for collision detection on bridges/tunnels. --- src/rail_cmd.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/rail_cmd.cpp') diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 4c6a01563..ac22758fa 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -1669,13 +1669,10 @@ static bool SignalVehicleCheck(TileIndex tile, uint track) /* check for a vehicle with that trackdir on the end tile of the tunnel */ if (VehicleFromPos(end, &dest, SignalVehicleCheckProc) != NULL) return true; - /* now check all tiles from start to end for a warping vehicle - * NOTE: the hashes for tiles may overlap, so this could maybe be optimised a bit by not checking every tile? */ + /* now check all tiles from start to end for a warping vehicle */ dest.track = 0x40; //Vehicle inside a tunnel or on a bridge - for (; tile != end; tile += TileOffsByDiagDir(direction)) { - if (VehicleFromPos(tile, &dest, SignalVehicleCheckProc) != NULL) - return true; - } + if (VehicleFromPos(tile, &dest, SignalVehicleCheckProc) != NULL) return true; + if (VehicleFromPos(end, &dest, SignalVehicleCheckProc) != NULL) return true; /* no vehicle found */ return false; -- cgit v1.2.3-54-g00ecf