mirror of https://github.com/OpenTTD/OpenTTD.git
Codechange: Use track functions.
This commit is contained in:
parent
a18b0eba5b
commit
a5836874ef
|
@ -59,7 +59,7 @@ public:
|
|||
/* handle special case - when next tile is destination tile */
|
||||
if (tile == v->dest_tile) {
|
||||
/* convert tracks to trackdirs */
|
||||
TrackdirBits trackdirs = (TrackdirBits)(tracks | ((int)tracks << 8));
|
||||
TrackdirBits trackdirs = TrackBitsToTrackdirBits(tracks);
|
||||
/* limit to trackdirs reachable from enterdir */
|
||||
trackdirs &= DiagdirReachesTrackdirs(enterdir);
|
||||
|
||||
|
|
|
@ -464,7 +464,7 @@ static Track ChooseShipTrack(Ship *v, TileIndex tile, DiagDirection enterdir, Tr
|
|||
if (v->dest_tile == 0 || DistanceManhattan(tile, v->dest_tile) > SHIP_MAX_ORDER_DISTANCE + 5) {
|
||||
/* No destination or destination too far, don't invoke pathfinder. */
|
||||
track = TrackBitsToTrack(v->state);
|
||||
if (track != TRACK_X && track != TRACK_Y) track = TrackToOppositeTrack(track);
|
||||
if (!IsDiagonalTrack(track)) track = TrackToOppositeTrack(track);
|
||||
if (!HasBit(tracks, track)) {
|
||||
/* Can't continue in same direction so pick first available track. */
|
||||
if (_settings_game.pf.forbid_90_deg) {
|
||||
|
|
Loading…
Reference in New Issue