Changeset - r1675:bc2e4696dafb
[Not reviewed]
master
0 1 0
matthijs - 20 years ago 2005-04-11 12:08:09
matthijs@openttd.org
(svn r2179) - Fix: [ 1121437, 1114228 ] Vehicles not entering depots for auto servicing.
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
train_cmd.c
Show inline comments
 
@@ -1321,13 +1321,17 @@ static TrainFindDepotData FindClosestTra
 
		NPFFoundTargetData ftd;
 
		byte trackdir = _track_direction_to_trackdir[FIND_FIRST_BIT(v->u.rail.track)][v->direction];
 
		ftd = NPFRouteToDepotBreadthFirst(v->tile, trackdir, TRANSPORT_RAIL, v->owner);
 
		if (ftd.best_bird_dist == 0) {
 
			/* Found target */
 
			tfdd.tile = ftd.node.tile;
 
			tfdd.best_length = ftd.best_path_dist;
 
			tfdd.best_length = ftd.best_path_dist / NPF_TILE_LENGTH;
 
			/* Our caller expects a number of tiles, so we just approximate that
 
			* number by this. It might not be completely what we want, but it will
 
			* work for now :-) We can possibly change this when the old pathfinder
 
			* is removed. */
 
		}
 
	} else if (!_patches.new_depot_finding) {
 
		// search in all directions
 
		for(i=0; i!=4; i++)
 
			NewTrainPathfind(tile, i, (TPFEnumProc*)TrainFindDepotEnumProc, &tfdd, NULL);
 
	} else {
0 comments (0 inline, 0 general)