summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/rustanddust/engine/PathBuilder.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/PathBuilder.java b/core/src/ch/asynk/rustanddust/engine/PathBuilder.java
index ae4c3fb..2d9b19c 100644
--- a/core/src/ch/asynk/rustanddust/engine/PathBuilder.java
+++ b/core/src/ch/asynk/rustanddust/engine/PathBuilder.java
@@ -164,7 +164,7 @@ public class PathBuilder implements Disposable
int l = (m + (r ? pawn.getRoadMarchBonus() : 0));
- if ((board.distance(next, to) <= l)) {
+ if (board.distance(next, to) <= l) {
if (next == to) {
Path path = Path.get(stack.size() + 1);
for (Tile t: stack) {
@@ -175,11 +175,10 @@ public class PathBuilder implements Disposable
path.fitness = f;
path.cost = (pawn.getMovementPoints() - m);
paths.add(path);
- } else {
- stack.add(next);
- findAllPaths(next, m, f, r);
- stack.remove(stack.size() - 1);
}
+ stack.add(next);
+ findAllPaths(next, m, f, r);
+ stack.remove(stack.size() - 1);
}
}
}