From 7c42ae01f9d0e25a86aa8badf9286d016278224b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 18 Nov 2014 10:02:59 +0100 Subject: StateMove: fix abort when nothing has been done --- core/src/ch/asynk/tankontank/game/states/StateMove.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- cgit v1.1-2-g2b99