(svn r104) Fix: wrong pathfinding when northern station tile is missing (blathijs)
authordominik
Sat, 21 Aug 2004 23:56:01 +0000
changeset 103 3af99b9373a1
parent 102 1d277a07f1f1
child 104 ba246e85459f
(svn r104) Fix: wrong pathfinding when northern station tile is missing (blathijs)
train_cmd.c
--- a/train_cmd.c	Sat Aug 21 22:04:25 2004 +0000
+++ b/train_cmd.c	Sat Aug 21 23:56:01 2004 +0000
@@ -1330,13 +1330,12 @@
 
 static void FillWithStationData(TrainTrackFollowerData *fd, Vehicle *v)
 {
-	uint tile;
-
-	fd->dest_coords = tile = v->dest_tile;
-	fd->station_index = -1;
-
-	if (IS_TILETYPE(tile, MP_STATION) && IS_BYTE_INSIDE(_map5[tile], 0, 8) )
-		fd->station_index = _map2[tile];
+        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;
+
 }
 
 static const byte _initial_tile_subcoord[6][4][3] = {