diff options
author | rubidium <rubidium@openttd.org> | 2006-08-15 14:27:53 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2006-08-15 14:27:53 +0000 |
commit | c54b71d4cee91cc5accccbdb44dfd38df0fb7e99 (patch) | |
tree | 28584e9345b4340d0ed4a9f1d166d8e3622c96d0 | |
parent | 721987817e2a6e8a59e2f4d9d1b73b2d1bf0750c (diff) | |
download | openttd-c54b71d4cee91cc5accccbdb44dfd38df0fb7e99.tar.xz |
(svn r5913) -Fix (r5906): GetVehicleOutOfTunnelTile did assert when the vehicles tile location is the exit of the tunnel.
-rw-r--r-- | tunnelbridge_cmd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c index 434f801b2..b37619b22 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; } |