Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uint choices = 0;
- /* Just follow track 1 tile and see if there is a track to follow. (try not to bang in coast or ship) */
- while (tracks != TRACK_BIT_NONE) {
- track = RemoveFirstTrack(&tracks);
- ti = TileIndexDiffCByDiagDir(TrackdirToExitdir(TrackEnterdirToTrackdir(track, diagdir)));
- TileIndex tile_check = TileAddWrap(tile, ti.x, ti.y);
- if (tile_check == INVALID_TILE) continue;
- if (HasVehicleOnPos(tile_check, &scc, FindShipOnTile)) continue;
- TrackBits bits = GetAvailShipTracks(tile_check, TrackdirToExitdir(TrackEnterdirToTrackdir(track, diagdir)));
- if (!IsDiagonalTrack(track)) bits &= TRACK_BIT_CROSS; // No 90 degree turns.
- if (bits != INVALID_TRACK_BIT && bits != TRACK_BIT_NONE) {
- choices++;
- if (choices < 2 || Chance16(1, 2)) {
- *track_old = track;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement