summaryrefslogtreecommitdiff
path: root/src/pathfinder/opf/opf_ship.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-08-18 11:37:47 +0000
committerfrosch <frosch@openttd.org>2012-08-18 11:37:47 +0000
commitd17ec934f55f5000cf30aa752437cc48cff19645 (patch)
tree68d5895b8ad40d12189102617bc8a15a0db3a3f6 /src/pathfinder/opf/opf_ship.cpp
parent0f0f027379181bf35b3e0b9ae6900cd3b0d82574 (diff)
downloadopenttd-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/opf_ship.cpp')
-rw-r--r--src/pathfinder/opf/opf_ship.cpp3
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) {