summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-18 10:02:59 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-18 10:02:59 +0100
commit7c42ae01f9d0e25a86aa8badf9286d016278224b (patch)
treea1eeefc6ebdeb24512a09b337226e09a5179f06e /core/src/ch/asynk/tankontank
parentaa7274c7312a04e3f9ec83b9c306314dacf25ecd (diff)
downloadRustAndDust-7c42ae01f9d0e25a86aa8badf9286d016278224b.zip
RustAndDust-7c42ae01f9d0e25a86aa8badf9286d016278224b.tar.gz
StateMove: fix abort when nothing has been done
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateMove.java5
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);