From 304923ce266bcfc6c52028b1b9f7342e7d4379a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 23 Dec 2015 21:35:41 +0100 Subject: StateRotate: fix bug when in HQ activation, start rotate, but do not complete it --- core/src/ch/asynk/rustanddust/game/states/StateRotate.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- cgit v1.1-2-g2b99