Loading

Paste #pt1vlref5

  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: break; // Just go north, because OPF gives assertion if it's asked to give a direction.
  14. +           case VPF_NPF: reverse = NPFShipCheckReverse(v); break; // Ugly behaviour. It better reverse mid-water than head to the worng direction.
  15. +           case VPF_YAPF: reverse = YapfShipCheckReverse(v); break; // Best looking behaviour.
  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
plgc7fnxc Anonymous 09 Apr 2015, 03:23:36 UTC Diff
pl9ow49la Anonymous 09 Apr 2015, 01:23:31 UTC Diff

Comments