diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/rustanddust/engine/PathBuilder.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/PathBuilder.java b/core/src/ch/asynk/rustanddust/engine/PathBuilder.java index af5d78b..9d564b5 100644 --- a/core/src/ch/asynk/rustanddust/engine/PathBuilder.java +++ b/core/src/ch/asynk/rustanddust/engine/PathBuilder.java @@ -107,7 +107,12 @@ public class PathBuilder implements Disposable this.to = to; // from and to are not part of the path this.distance = board.distance(from, to); - findAllPaths(from, pawn.getMovementPoints(), 0, true); + if (distance == 0) { + Path path = Path.get(0); + path.cost = 0; + paths.add(path); + } else + findAllPaths(from, pawn.getMovementPoints(), 0, true); // printToErr("paths", paths); stack.clear(); |