Index: src/ship_cmd.cpp
===================================================================
--- src/ship_cmd.cpp (revision 27221)
+++ src/ship_cmd.cpp (working copy)
@@ -335,9 +335,11 @@
TrackBits north_tracks = DiagdirReachesTracks(north_dir) & GetTileShipTrackStatus(north_neighbour);
TrackBits south_tracks = DiagdirReachesTracks(south_dir) & GetTileShipTrackStatus(south_neighbour);
+
+ bool reverse = false;
+
if (north_tracks && south_tracks) {
/* Ask pathfinder for best direction */
- bool reverse = false;
bool path_found;
switch (_settings_game.pf.pathfinder_for_ships) {
case VPF_OPF: reverse = OPFShipChooseTrack(v, north_neighbour, north_dir, north_tracks, path_found) == INVALID_TRACK; break; // OPF always allows reversing
@@ -356,7 +358,11 @@
v->direction = DiagDirToDir(south_dir);
} else {
/* Both ways blocked */
- return false;
+ if (reverse) {
+ v->direction = DiagDirToDir(south_dir);
+ } else {
+ v->direction = DiagDirToDir(north_dir);
+ }
}
v->state = AxisToTrackBits(axis);