From 33c1b6866c09e191b55b7d3225bfd011c67e3c43 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 15 Aug 2006 14:27:53 +0000 Subject: [PATCH] (svn r5913) -Fix (r5906): GetVehicleOutOfTunnelTile did assert when the vehicles tile location is the exit of the tunnel. --- tunnelbridge_cmd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c index 434f801b2c..b37619b22f 100644 --- a/tunnelbridge_cmd.c +++ b/tunnelbridge_cmd.c @@ -1438,13 +1438,13 @@ TileIndex GetVehicleOutOfTunnelTile(const Vehicle *v) byte z = v->z_pos; dir = ReverseDiagDir(dir); - do { - tile += delta; - } while ( + while ( !IsTunnelTile(tile) || GetTunnelDirection(tile) != dir || GetTileZ(tile) != z - ); + ) { + tile += delta; + } return tile; }