diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-21 16:17:14 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-21 16:17:14 +0100 |
commit | a2dcd60251ba6c353e9dbb9c163047d40fb9955c (patch) | |
tree | 6f4a142bbfe160540ac233ebda582c9bc332737b /core/src | |
parent | 0b9d19d55c63156c8ac103c43d91ed6ba8a7167d (diff) | |
download | RustAndDust-a2dcd60251ba6c353e9dbb9c163047d40fb9955c.zip RustAndDust-a2dcd60251ba6c353e9dbb9c163047d40fb9955c.tar.gz |
StateMove,StateRotate: fix entry move abortion
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/states/StateMove.java | 9 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/states/StateRotate.java | 4 |
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; |