summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-05 17:21:42 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-05 17:21:42 +0100
commite3fce2b2ec21cb787b21a8327bc71dd0127247e4 (patch)
tree62764dfea2bf3c178e6b031fa3aa4435be72602a /core/src/ch/asynk/tankontank
parentbf58e77fbf5536d8fe730acec496f536ac72f647 (diff)
downloadRustAndDust-e3fce2b2ec21cb787b21a8327bc71dd0127247e4.zip
RustAndDust-e3fce2b2ec21cb787b21a8327bc71dd0127247e4.tar.gz
StateMove,StateRotate: correctly revert entry moves
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateMove.java4
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateRotate.java5
2 files changed, 9 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/StateMove.java b/core/src/ch/asynk/tankontank/game/states/StateMove.java
index f96678a..657c9bd 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateMove.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateMove.java
@@ -83,6 +83,10 @@ public class StateMove extends StateCommon
hideAssists();
ctrl.setAnimationCount(map.activatedPawns.size());
map.revertMoves();
+ if (activeUnit.move.entryMove) {
+ map.leaveBoard(activeUnit);
+ ctrl.player.revertUnitEntry(activeUnit);
+ }
super.abort();
}
diff --git a/core/src/ch/asynk/tankontank/game/states/StateRotate.java b/core/src/ch/asynk/tankontank/game/states/StateRotate.java
index 2b63535..2a90eeb 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateRotate.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateRotate.java
@@ -71,6 +71,11 @@ public class StateRotate extends StateCommon
public void abort()
{
ctrl.hud.hide();
+ if (activeUnit.move.entryMove) {
+ map.leaveBoard(activeUnit);
+ ctrl.player.revertUnitEntry(activeUnit);
+ super.abort();
+ }
if (map.activatedPawns.size() == 0) {
hideAssists();
super.abort();