diff options
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/map/Map2Moves.java | 1 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/states/StateBreak.java | 11 |
2 files changed, 6 insertions, 6 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/map/Map2Moves.java b/core/src/ch/asynk/rustanddust/game/map/Map2Moves.java index c235de3..411e2c9 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map2Moves.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map2Moves.java @@ -75,6 +75,7 @@ public abstract class Map2Moves extends Map1Units public void pathsSetExit(Orientation o) { paths.setExit(o); } public boolean pathsContains(Hex hex) { return paths.contains(hex); } public int pathsChooseBest() { return paths.chooseBest(); } + public int pathsChooseShortest() { return paths.chooseShortest(); } public int pathsToggleHex(Hex hex) { boolean enable = !hex.isOverlayEnabled(Hex.MOVE); diff --git a/core/src/ch/asynk/rustanddust/game/states/StateBreak.java b/core/src/ch/asynk/rustanddust/game/states/StateBreak.java index 631d9d2..98b6f61 100644 --- a/core/src/ch/asynk/rustanddust/game/states/StateBreak.java +++ b/core/src/ch/asynk/rustanddust/game/states/StateBreak.java @@ -68,11 +68,10 @@ public class StateBreak extends StateCommon if (activeUnit == null) return; map.pathsInit(activeUnit); - if (map.pathsBuild(to) == 1) { - map.pathsSetOrientation(o); - map.moveUnit(activeUnit); - ctrl.setAfterAnimationState(StateType.DONE); - } else - RustAndDust.debug("That's very wrong there should be only one path"); + map.pathsBuild(to); + map.pathsChooseShortest(); + map.pathsSetOrientation(o); + map.moveUnit(activeUnit); + ctrl.setAfterAnimationState(StateType.DONE); } } |