Loading

Paste #p0qkcrvdy

  1. TileIndex tile = whatever tile the ship is;
  2. DiagDirection direction = whatever direction the ship is headed;
  3.  
  4. TrackBits bits = TrackStatusToTrackBits(GetTileTrackStatus(tile, TRANSPORT_WATER, 0)) & DiagdirReachesTracks(direction);
  5. Track track = RemoveFirstTrack(&bits);
  6. TrackdirBits trackdirbits = TrackStatusToTrackdirBits(TrackToTrackBits(track) & DiagdirReachesTracks(direction));
  7. Trackdir trackdir = RemoveFirstTrackdir(&trackdirbits);

Comments