summaryrefslogtreecommitdiff
path: root/src/pathfinder/opf
diff options
context:
space:
mode:
authorJ0anJosep <juanjo.ng.83@gmail.com>2018-05-12 18:19:40 +0200
committerfrosch <github@elsenhans.name>2018-06-27 23:14:30 +0200
commitd01c09fb73aacd1b3c204829e7c574bbde09153f (patch)
tree5327845c01eeba8864925a38d97ab210b58f1850 /src/pathfinder/opf
parent31ac11bddb71945bba57d0cefac620f455963455 (diff)
downloadopenttd-d01c09fb73aacd1b3c204829e7c574bbde09153f.tar.xz
Codechange: Use HasTrack(dir) to improve code readability.
Diffstat (limited to 'src/pathfinder/opf')
-rw-r--r--src/pathfinder/opf/opf_ship.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pathfinder/opf/opf_ship.cpp b/src/pathfinder/opf/opf_ship.cpp
index e3b7db5a6..1a866337c 100644
--- a/src/pathfinder/opf/opf_ship.cpp
+++ b/src/pathfinder/opf/opf_ship.cpp
@@ -206,7 +206,7 @@ Track OPFShipChooseTrack(const Ship *v, TileIndex tile, DiagDirection enterdir,
TrackBits rev_tracks = TrackStatusToTrackBits(GetTileTrackStatus(tile2, TRANSPORT_WATER, 0)) &
DiagdirReachesTracks(rev_enterdir);
- if ((rev_tracks & TrackToTrackBits(cur_track) != TRACK_BIT_NONE) {
+ if (HasTrack(rev_tracks, cur_track)) {
rev_dist = FindShipTrack(v, tile2, rev_enterdir, TrackToTrackBits(cur_track), tile, &track);
if (rev_dist != UINT_MAX) rev_dist++; // penalty for reversing
}