diff options
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/SearchBoard.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/SearchBoard.java b/core/src/ch/asynk/tankontank/engine/SearchBoard.java index 26b05b5..6f22f74 100644 --- a/core/src/ch/asynk/tankontank/engine/SearchBoard.java +++ b/core/src/ch/asynk/tankontank/engine/SearchBoard.java @@ -159,11 +159,11 @@ public class SearchBoard while (stack.size() != 0) { Node src = stack.pop(); - if (src.remaining <= 0) { - if (src.roadMarch) { - src.remaining = roadMarchBonus; + if (src.remaining < 0) + continue; + if (src.remaining == 0) { + if (src.roadMarch) roadMarch.push(src); - } continue; } @@ -206,6 +206,7 @@ public class SearchBoard first = false; } + for (Node n : roadMarch) n.remaining = roadMarchBonus; while(roadMarch.size() != 0) { Node src = roadMarch.pop(); |