diff options
author | frosch <frosch@openttd.org> | 2012-08-18 11:37:47 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-08-18 11:37:47 +0000 |
commit | d17ec934f55f5000cf30aa752437cc48cff19645 (patch) | |
tree | 68d5895b8ad40d12189102617bc8a15a0db3a3f6 /src/pathfinder/opf | |
parent | 0f0f027379181bf35b3e0b9ae6900cd3b0d82574 (diff) | |
download | openttd-d17ec934f55f5000cf30aa752437cc48cff19645.tar.xz |
(svn r24481) -Feature [FS#5127]: Make the pathfinder decide whether ships shall leave depots towards north or south.
Diffstat (limited to 'src/pathfinder/opf')
-rw-r--r-- | src/pathfinder/opf/opf_ship.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pathfinder/opf/opf_ship.cpp b/src/pathfinder/opf/opf_ship.cpp index 9cf574484..850577de1 100644 --- a/src/pathfinder/opf/opf_ship.cpp +++ b/src/pathfinder/opf/opf_ship.cpp @@ -193,7 +193,8 @@ Track OPFShipChooseTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, Track track; /* Let's find out how far it would be if we would reverse first */ - TrackBits b = TrackStatusToTrackBits(GetTileTrackStatus(tile2, TRANSPORT_WATER, 0)) & DiagdirReachesTracks(ReverseDiagDir(enterdir)) & v->state; + Trackdir trackdir = v->GetVehicleTrackdir(); + TrackBits b = TrackStatusToTrackBits(GetTileTrackStatus(tile2, TRANSPORT_WATER, 0)) & DiagdirReachesTracks(ReverseDiagDir(enterdir)) & TrackdirBitsToTrackBits(TrackdirToTrackdirBits(trackdir)); uint distr = UINT_MAX; // distance if we reversed if (b != 0) { |