Changeset - r20008:f9bad3dc2be1
[Not reviewed]
master
0 1 0
rubidium - 12 years ago 2013-02-03 14:16:45
rubidium@openttd.org
(svn r24964) -Fix [FS#5416]: With YAPF the docking behaviour differed per direction; now favour docking in the direction you approached
1 file changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/pathfinder/yapf/yapf_ship.cpp
Show inline comments
 
@@ -58,9 +58,12 @@ public:
 
		if (tile == v->dest_tile) {
 
			/* convert tracks to trackdirs */
 
			TrackdirBits trackdirs = (TrackdirBits)(tracks | ((int)tracks << 8));
 
			/* choose any trackdir reachable from enterdir */
 
			/* limit to trackdirs reachable from enterdir */
 
			trackdirs &= DiagdirReachesTrackdirs(enterdir);
 
			return (Trackdir)FindFirstBit2x64(trackdirs);
 

	
 
			/* use vehicle's current direction if that's possible, otherwise use first usable one. */
 
			Trackdir veh_dir = v->GetVehicleTrackdir();
 
			return ((trackdirs & TrackdirToTrackdirBits(veh_dir)) != 0) ? veh_dir : (Trackdir)FindFirstBit2x64(trackdirs);
 
		}
 

	
 
		/* move back to the old tile/trackdir (where ship is coming from) */
0 comments (0 inline, 0 general)