Codechange: Use HasTrack(dir) to improve code readability.

This commit is contained in:
J0anJosep
2018-05-12 18:19:40 +02:00
committed by frosch
parent 31ac11bddb
commit d01c09fb73
7 changed files with 31 additions and 9 deletions

View File

@@ -65,7 +65,7 @@ public:
/* 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);
return (HasTrackdir(trackdirs, veh_dir)) ? veh_dir : (Trackdir)FindFirstBit2x64(trackdirs);
}
/* move back to the old tile/trackdir (where ship is coming from) */