From d01c09fb73aacd1b3c204829e7c574bbde09153f Mon Sep 17 00:00:00 2001 From: J0anJosep Date: Sat, 12 May 2018 18:19:40 +0200 Subject: Codechange: Use HasTrack(dir) to improve code readability. --- src/pathfinder/opf/opf_ship.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pathfinder/opf') 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 } -- cgit v1.2.3-70-g09d2