| | 9 | - if (north_tracks && south_tracks) {
|
---|
| | 10 | - /* Ask pathfinder for best direction */
|
---|
| | 11 | - bool reverse = false;
|
---|
| | 12 | - bool path_found;
|
---|
| | 13 | - switch (_settings_game.pf.pathfinder_for_ships) {
|
---|
| | 14 | - case VPF_OPF: reverse = OPFShipChooseTrack(v, north_neighbour, north_dir, north_tracks, path_found) == INVALID_TRACK; break; // OPF always allows reversing
|
---|
| | 15 | - case VPF_NPF: reverse = NPFShipCheckReverse(v); break;
|
---|
| | 16 | - case VPF_YAPF: reverse = YapfShipCheckReverse(v); break;
|
---|
| | 17 | - default: NOT_REACHED();
|
---|
| | 18 | - }
|
---|
| | 19 | - if (reverse) north_tracks = TRACK_BIT_NONE;
|
---|
11 | +
| 23 | + bool path_found;
|
---|
12 | if (north_tracks && south_tracks) {
| 24 | + switch (_settings_game.pf.pathfinder_for_ships) {
|
---|
13 | /* Ask pathfinder for best direction */
| 25 | + case VPF_OPF: reverse = OPFShipChooseTrack(v, north_neighbour, north_dir, north_tracks, path_found) == INVALID_TRACK; break; // OPF always allows reversing
|
---|
14 | - bool reverse = false;
| 26 | + case VPF_NPF: reverse = NPFShipCheckReverse(v); break;
|
---|
15 | bool path_found;
| 27 | + case VPF_YAPF: reverse = YapfShipCheckReverse(v); break;
|
---|
16 | switch (_settings_game.pf.pathfinder_for_ships) {
| 28 | + default: NOT_REACHED();
|
---|
17 | case VPF_OPF: reverse = OPFShipChooseTrack(v, north_neighbour, north_dir, north_tracks, path_found) == INVALID_TRACK; break; // OPF always allows reversing
| 29 | }
|
---|
18 | @@ -356,7 +358,11 @@
| 30 | -
|
---|
| | 31 | + if (reverse) north_tracks = TRACK_BIT_NONE;
|
---|
| | 32 | +
|
---|
| | 33 | if (north_tracks) {
|
---|
| | 34 | /* Leave towards north */
|
---|
| | 35 | v->direction = DiagDirToDir(north_dir);
|
---|
| | 36 | @@ -356,7 +355,11 @@
|
---|