summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ship_cmd.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index 88e2392e0..1594c2bf4 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -464,10 +464,8 @@ static Track ChooseShipTrack(Ship *v, TileIndex tile, DiagDirection enterdir, Tr
track = TrackBitsToTrack(v->state);
if (track != TRACK_X && track != TRACK_Y) track = TrackToOppositeTrack(track);
if (!HasBit(tracks, track)) {
- /* Can't continue in same direction so pick a random available track. */
- do {
- track = (Track)RandomRange(TRACK_END);
- } while ((TrackToTrackBits(track) & tracks) == TRACK_BIT_NONE);
+ /* Can't continue in same direction so pick first available track. */
+ track = FindFirstTrack(tracks);
}
path_found = false;
} else {