summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-10 11:53:05 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-10 11:53:05 +0100
commita6cab36024b954d4aaf260d0c0ac24ab7044f8f9 (patch)
treebeaaa3200a50f173e45cf879dbe207e6d10784dc /core/src/ch/asynk
parent2cfbb884e942492d1389fbd47daeeb74451235c8 (diff)
downloadRustAndDust-a6cab36024b954d4aaf260d0c0ac24ab7044f8f9.zip
RustAndDust-a6cab36024b954d4aaf260d0c0ac24ab7044f8f9.tar.gz
Pawn,Unit: fix the way the Unit is marked has moved
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Pawn.java5
-rw-r--r--core/src/ch/asynk/tankontank/game/Unit.java2
2 files changed, 6 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java
index b81f8c2..c10d3e7 100644
--- a/core/src/ch/asynk/tankontank/engine/Pawn.java
+++ b/core/src/ch/asynk/tankontank/engine/Pawn.java
@@ -84,6 +84,11 @@ public abstract class Pawn implements Moveable, Disposable
entryMove = false;
orientation = Orientation.KEEP;
}
+
+ public boolean isComplete()
+ {
+ return ((from != null) && (to != null));
+ }
}
private static final float MOVE_TIME = 0.4f;
diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java
index 3e5052e..e97ff2f 100644
--- a/core/src/ch/asynk/tankontank/game/Unit.java
+++ b/core/src/ch/asynk/tankontank/game/Unit.java
@@ -205,7 +205,7 @@ public class Unit extends HeadedPawn
TankOnTank.debug(move.toString());
if (move.cost > mpLeft) TankOnTank.debug("ERROR: Movement point exceeded: " + move.cost + "/" + mpLeft + " please report");
- if (!move.entryMove) {
+ if (move.isComplete()) {
hasMoved = true;
}
mpLeft -= move.cost;