summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateMove.java9
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateRotate.java4
2 files changed, 7 insertions, 6 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/StateMove.java b/core/src/ch/asynk/tankontank/game/states/StateMove.java
index 6c3b144..0b90188 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateMove.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateMove.java
@@ -67,15 +67,16 @@ public class StateMove extends StateCommon
public StateType abort()
{
hideAssists();
+ if (activeUnit.movement.entryMove) {
+ map.leaveBoard(activeUnit);
+ ctrl.player.revertUnitEntry(activeUnit);
+ return StateType.ABORT;
+ }
int n = map.activatedUnits.size();
if (n == 0)
return StateType.ABORT;
ctrl.setAnimationCount(n);
map.revertMoves();
- if (activeUnit.movement.entryMove) {
- map.leaveBoard(activeUnit);
- ctrl.player.revertUnitEntry(activeUnit);
- }
return StateType.ANIMATION;
}
diff --git a/core/src/ch/asynk/tankontank/game/states/StateRotate.java b/core/src/ch/asynk/tankontank/game/states/StateRotate.java
index ddc5737..55f4d4d 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateRotate.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateRotate.java
@@ -59,8 +59,8 @@ public class StateRotate extends StateCommon
if (activeUnit.movement.entryMove) {
map.leaveBoard(activeUnit);
ctrl.player.revertUnitEntry(activeUnit);
- }
- if (map.activatedUnits.size() == 0) {
+ nextState = StateType.ABORT;
+ } else if (map.activatedUnits.size() == 0) {
hideAssists();
} else {
nextState = StateType.MOVE;