From c4fe46a475d141938b75784044e2e6e2ec634d72 Mon Sep 17 00:00:00 2001 From: J0an Josep Date: Tue, 19 Feb 2019 00:11:25 +0100 Subject: Fix #7244, 6ca637b8c1: OPF doesn't take 90 deg turns into account. --- src/ship_cmd.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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; } -- cgit v1.2.3-70-g09d2