diff options
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/SearchBoard.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/SearchBoard.java b/core/src/ch/asynk/tankontank/engine/SearchBoard.java index 6be0977..d00d056 100644 --- a/core/src/ch/asynk/tankontank/engine/SearchBoard.java +++ b/core/src/ch/asynk/tankontank/engine/SearchBoard.java @@ -536,8 +536,15 @@ public class SearchBoard Node from = getNode(col0, row0); Node to = getNode(col1, row1); - path.add(from); - findAllPaths(pawn, from, to, pawn.getMovementPoints(), true, pawn.getRoadMarchBonus()); + if (distance(from, to) == 1) { + Vector<Node> temp = new Vector<Node>(2); + temp.add(to); + temp.add(from); + possiblePaths.add(temp); + } else { + path.add(from); + findAllPaths(pawn, from, to, pawn.getMovementPoints(), true, pawn.getRoadMarchBonus()); + } return possiblePaths; } |