summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-12-23 21:35:41 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-12-23 21:35:41 +0100
commit304923ce266bcfc6c52028b1b9f7342e7d4379a7 (patch)
treede3b6b6f25ad5001a6f00ce173c2957a1df35cef /core
parenta1f8f91ba93e2ca9655373130ae8bd841ca0275e (diff)
downloadRustAndDust-304923ce266bcfc6c52028b1b9f7342e7d4379a7.zip
RustAndDust-304923ce266bcfc6c52028b1b9f7342e7d4379a7.tar.gz
StateRotate: fix bug when in HQ activation, start rotate, but do not complete it
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/rustanddust/game/states/StateRotate.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/states/StateRotate.java b/core/src/ch/asynk/rustanddust/game/states/StateRotate.java
index b3159f5..2e9b520 100644
--- a/core/src/ch/asynk/rustanddust/game/states/StateRotate.java
+++ b/core/src/ch/asynk/rustanddust/game/states/StateRotate.java
@@ -22,7 +22,7 @@ public class StateRotate extends StateCommon
map.pathsBuild(to);
}
- if (map.pathsSize() != 1)
+ if (map.pathsSize() > 1)
RustAndDust.debug("ERROR: pathsSize() == " + map.pathsSize());
rotateOnly = (to == activeUnit.getHex());
@@ -64,6 +64,9 @@ public class StateRotate extends StateCommon
@Override
public StateType execute()
{
+ if (!rotationSet)
+ return StateType.DONE;
+
StateType whenDone = StateType.DONE;
if (map.moveUnit(activeUnit) > 0)