From d2dd128b0d68d0b388890f8ff36e184b7d52afca Mon Sep 17 00:00:00 2001 From: truelight Date: Mon, 6 Sep 2004 18:33:51 +0000 Subject: [PATCH] (svn r167) -Fix: [972247] bug in '[a] weird non-uniform stations handling' (blathijs) --- train_cmd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/train_cmd.c b/train_cmd.c index 342883e1f6..4c2f52d2ac 100644 --- a/train_cmd.c +++ b/train_cmd.c @@ -1306,8 +1306,11 @@ static bool TrainTrackFollower(uint tile, TrainTrackFollowerData *ttfd, int trac return false; // did we reach the final station? - if (tile == ttfd->dest_coords || - (IS_TILETYPE(tile, MP_STATION) && IS_BYTE_INSIDE(_map5[tile], 0, 8) && _map2[tile] == ttfd->station_index)) { + if ((ttfd->station_index == -1 && tile == ttfd->dest_coords) || + (IS_TILETYPE(tile, MP_STATION) && IS_BYTE_INSIDE(_map5[tile], 0, 8) && _map2[tile] == ttfd->station_index)) { + /* We do not check for dest_coords if we have a station_index, + * because in that case the dest_coords are just an + * approximation of where the station is */ // found station ttfd->best_bird_dist = 0; if (length < ttfd->best_track_dist) {