(svn r5913) -Fix (r5906): GetVehicleOutOfTunnelTile did assert when the vehicles tile location is the exit of the tunnel.
authorrubidium
Tue, 15 Aug 2006 14:27:53 +0000
changeset 4283 290c71352be1
parent 4282 9394aef5b65b
child 4284 ea9579c54725
(svn r5913) -Fix (r5906): GetVehicleOutOfTunnelTile did assert when the vehicles tile location is the exit of the tunnel.
tunnelbridge_cmd.c
--- a/tunnelbridge_cmd.c	Tue Aug 15 13:31:43 2006 +0000
+++ b/tunnelbridge_cmd.c	Tue Aug 15 14:27:53 2006 +0000
@@ -1438,13 +1438,13 @@
 	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;
 }