summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-12-24 10:46:03 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-12-24 10:46:03 +0100
commit3d7c5a8f04db00072d591fdc3e824c2c53fafdc0 (patch)
tree2976df8eae2664e87e8570151dce6e6ff6dd72fd
parentccc519f006f363a129943d17d616b67660ce0f42 (diff)
downloadRustAndDust-3d7c5a8f04db00072d591fdc3e824c2c53fafdc0.zip
RustAndDust-3d7c5a8f04db00072d591fdc3e824c2c53fafdc0.tar.gz
States: do not use downHex or upHex out of touchDown() and touchUp()
-rw-r--r--core/src/ch/asynk/rustanddust/game/states/StateDeployment.java4
-rw-r--r--core/src/ch/asynk/rustanddust/game/states/StateReinforcement.java6
2 files changed, 5 insertions, 5 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/states/StateDeployment.java b/core/src/ch/asynk/rustanddust/game/states/StateDeployment.java
index a8c3030..14c015e 100644
--- a/core/src/ch/asynk/rustanddust/game/states/StateDeployment.java
+++ b/core/src/ch/asynk/rustanddust/game/states/StateDeployment.java
@@ -99,10 +99,10 @@ public class StateDeployment extends StateCommon
selectedUnit = unit;
selectedHex = hex;
ctrl.battle.getPlayer().reinforcement.remove(unit);
- map.showOnBoard(unit, upHex, entryZone.orientation);
+ map.showOnBoard(unit, hex, entryZone.orientation);
deployedUnits.add(unit);
entryZone.enable(Hex.AREA, false);
- showRotation(unit, upHex);
+ showRotation(unit, hex);
ctrl.hud.update();
}
diff --git a/core/src/ch/asynk/rustanddust/game/states/StateReinforcement.java b/core/src/ch/asynk/rustanddust/game/states/StateReinforcement.java
index 846adce..304e2b5 100644
--- a/core/src/ch/asynk/rustanddust/game/states/StateReinforcement.java
+++ b/core/src/ch/asynk/rustanddust/game/states/StateReinforcement.java
@@ -67,13 +67,13 @@ public class StateReinforcement extends StateCommon
entryZone.enable(Hex.AREA, true);
}
- private void unitEnter(Unit unit)
+ private void unitEnter(Unit unit, Hex hex)
{
selectedUnit = unit;
- selectedHex = upHex;
+ selectedHex = hex;
map.hexSelect(selectedHex);
entryZone.enable(Hex.AREA, false);
- if (map.enterBoard(unit, upHex, entryZone.allowedMoves)) {
+ if (map.enterBoard(unit, hex, entryZone.allowedMoves)) {
if (unit.getMovementPoints() > 0)
ctrl.setState(StateType.MOVE);
else