diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-20 09:27:32 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-20 09:27:32 +0100 |
commit | ae0e7d1c1c03eceeba145a47d96c87d87df32fc5 (patch) | |
tree | 18203137b5163c75e39a2b57b4e9909c3aa87d34 /core | |
parent | a838f68aa71ce6d308835147e34df788a7d8aeb9 (diff) | |
download | RustAndDust-ae0e7d1c1c03eceeba145a47d96c87d87df32fc5.zip RustAndDust-ae0e7d1c1c03eceeba145a47d96c87d87df32fc5.tar.gz |
StateDeployment: fix undo
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/states/StateDeployment.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/StateDeployment.java b/core/src/ch/asynk/tankontank/game/states/StateDeployment.java index c3a333e..6129631 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateDeployment.java +++ b/core/src/ch/asynk/tankontank/game/states/StateDeployment.java @@ -44,7 +44,8 @@ public class StateDeployment extends StateCommon @Override public StateType abort() { - undo(); + if (activeUnit != null) + undo(); return StateType.DEPLOYMENT; } @@ -73,8 +74,10 @@ public class StateDeployment extends StateCommon unitEnter(activeUnit); } else { unit = downHex.getUnit(); - if (deployedUnits.contains(unit)) + if (deployedUnits.contains(unit)) { showRotation(unit, downHex); + activeUnit = unit; + } } } |