Loading

Paste #plgc7fnxc

  1. Index: src/ship_cmd.cpp
  2. ===================================================================
  3. --- src/ship_cmd.cpp    (revision 27221)
  4. +++ src/ship_cmd.cpp    (working copy)
  5. @@ -356,7 +356,19 @@
  6.         v->direction = DiagDirToDir(south_dir);
  7.     } else {
  8.         /* Both ways blocked */
  9. -       return false;
  10. +       /* Ask pathfinder for best direction */
  11. +       bool reverse = false;
  12. +       switch (_settings_game.pf.pathfinder_for_ships) {
  13. +           case VPF_OPF: reverse = true; break; // OPF always allows reversing
  14. +           case VPF_NPF: reverse = NPFShipCheckReverse(v); break;
  15. +           case VPF_YAPF: reverse = YapfShipCheckReverse(v); break;
  16. +       default: NOT_REACHED();
  17. +       }
  18. +       if (reverse) {
  19. +           v->direction = DiagDirToDir(south_dir);
  20. +       } else {
  21. +           v->direction = DiagDirToDir(north_dir);
  22. +       }
  23.     }
  24.  
  25.     v->state = AxisToTrackBits(axis);

Version history

Revision # Author Created at
pl9ow49la Anonymous 09 Apr 2015, 01:23:31 UTC Diff

Comments