diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-12-03 11:43:42 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-12-03 11:43:42 +0100 |
commit | c0e21f1e5d0a791b30aff89ac0401b4dad5ca881 (patch) | |
tree | 5ba950bb5a42d9cae6978183a6dbeac50a2b4f0a | |
parent | 3fbb77c4a770bb82a53215b8d74a071999fd4af9 (diff) | |
download | RustAndDust-c0e21f1e5d0a791b30aff89ac0401b4dad5ca881.zip RustAndDust-c0e21f1e5d0a791b30aff89ac0401b4dad5ca881.tar.gz |
StateRotate: any touch out of adjacents aborts the action
-rw-r--r-- | core/src/ch/asynk/tankontank/game/states/StateRotate.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/StateRotate.java b/core/src/ch/asynk/tankontank/game/states/StateRotate.java index f15b360..f67982e 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateRotate.java +++ b/core/src/ch/asynk/tankontank/game/states/StateRotate.java @@ -82,16 +82,14 @@ public class StateRotate extends StateCommon @Override public void touchUp() { - if (upHex == activeUnit.getHex()) { - ctrl.setState(StateType.ABORT); - return; - } - if (rotationSet) return; o = Orientation.fromAdj(to, upHex); + if (o == Orientation.KEEP) { + ctrl.setState(StateType.ABORT); + return; + } - if (o == Orientation.KEEP) return; if (!activeUnit.movement.entryMove && rotateOnly && (o == activeUnit.getOrientation())) return; rotationSet = true; |