summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust/game/states
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-01-04 20:52:07 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-01-04 20:52:07 +0100
commitce4863a2b70b9ca2e6805a0f03e21dc8f04fc5b9 (patch)
tree5c3548ef8fd239844d016f17671f5bbe663b0d36 /core/src/ch/asynk/rustanddust/game/states
parent480b3f753cc68799db7ec0d440d8c995730e23c1 (diff)
downloadRustAndDust-ce4863a2b70b9ca2e6805a0f03e21dc8f04fc5b9.zip
RustAndDust-ce4863a2b70b9ca2e6805a0f03e21dc8f04fc5b9.tar.gz
StateBreak: use chooseShortest()
Diffstat (limited to 'core/src/ch/asynk/rustanddust/game/states')
-rw-r--r--core/src/ch/asynk/rustanddust/game/states/StateBreak.java11
1 files changed, 5 insertions, 6 deletions
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);
}
}