From c7baa9b10ad2480107164d3ae0e638cfa11efa5a Mon Sep 17 00:00:00 2001 From: dominik Date: Sat, 21 Aug 2004 23:56:01 +0000 Subject: (svn r104) Fix: wrong pathfinding when northern station tile is missing (blathijs) --- train_cmd.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'train_cmd.c') diff --git a/train_cmd.c b/train_cmd.c index 85601bfb4..7f04b19b2 100644 --- a/train_cmd.c +++ b/train_cmd.c @@ -1330,13 +1330,12 @@ static bool TrainTrackFollower(uint tile, TrainTrackFollowerData *ttfd, int trac static void FillWithStationData(TrainTrackFollowerData *fd, Vehicle *v) { - uint tile; - - fd->dest_coords = tile = v->dest_tile; - fd->station_index = -1; + fd->dest_coords = v->dest_tile; + if ((v->next_order & OT_MASK) == OT_GOTO_STATION) + fd->station_index = v->next_order_param; + else + fd->station_index = -1; - if (IS_TILETYPE(tile, MP_STATION) && IS_BYTE_INSIDE(_map5[tile], 0, 8) ) - fd->station_index = _map2[tile]; } static const byte _initial_tile_subcoord[6][4][3] = { -- cgit v1.2.3-54-g00ecf