diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-18 10:02:59 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-18 10:02:59 +0100 |
commit | 7c42ae01f9d0e25a86aa8badf9286d016278224b (patch) | |
tree | a1eeefc6ebdeb24512a09b337226e09a5179f06e | |
parent | aa7274c7312a04e3f9ec83b9c306314dacf25ecd (diff) | |
download | RustAndDust-7c42ae01f9d0e25a86aa8badf9286d016278224b.zip RustAndDust-7c42ae01f9d0e25a86aa8badf9286d016278224b.tar.gz |
StateMove: fix abort when nothing has been done
-rw-r--r-- | core/src/ch/asynk/tankontank/game/states/StateMove.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/StateMove.java b/core/src/ch/asynk/tankontank/game/states/StateMove.java index 0300aed..3d3dbe0 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateMove.java +++ b/core/src/ch/asynk/tankontank/game/states/StateMove.java @@ -56,7 +56,10 @@ public class StateMove extends StateCommon public StateType abort() { hideAssists(); - ctrl.setAnimationCount(map.activatedPawns.size()); + int n = map.activatedPawns.size(); + if (n == 0) + return StateType.ABORT; + ctrl.setAnimationCount(n); map.revertMoves(); if (activeUnit.movement.entryMove) { map.leaveBoard(activeUnit); |