src/rail_cmd.cpp
changeset 7867 07a2830337ce
parent 7866 e19fda04e8d3
child 7885 4eb9b01e37ff
--- a/src/rail_cmd.cpp	Sun Jul 29 23:42:59 2007 +0000
+++ b/src/rail_cmd.cpp	Mon Jul 30 08:49:41 2007 +0000
@@ -1669,13 +1669,10 @@
 		/* 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;