summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJ0an Josep <juanjo.ng.83@gmail.com>2019-02-19 00:11:25 +0100
committerMichael Lutz <michi@icosahedron.de>2019-02-19 01:06:10 +0100
commitc4fe46a475d141938b75784044e2e6e2ec634d72 (patch)
treef6a1c8581f72b3d5583380195003e441c4128078 /src
parent45ce5171058bc40cf6423fda0f9419f11397759d (diff)
downloadopenttd-c4fe46a475d141938b75784044e2e6e2ec634d72.tar.xz
Fix #7244, 6ca637b8c1: OPF doesn't take 90 deg turns into account.
Diffstat (limited to 'src')
-rw-r--r--src/ship_cmd.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index c4441cb15..c2ce5adc9 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -521,7 +521,8 @@ static inline TrackBits GetAvailShipTracks(TileIndex tile, DiagDirection dir, Tr
{
TrackBits tracks = GetTileShipTrackStatus(tile) & DiagdirReachesTracks(dir);
- if (_settings_game.pf.forbid_90_deg) tracks &= ~TrackCrossesTracks(TrackdirToTrack(trackdir));
+ /* Do not remove 90 degree turns for OPF, as it isn't able to find paths taking it into account. */
+ if (_settings_game.pf.forbid_90_deg && _settings_game.pf.pathfinder_for_ships != VPF_OPF) tracks &= ~TrackCrossesTracks(TrackdirToTrack(trackdir));
return tracks;
}