summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/game/Unit.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java
index 7ff3720..f7369f6 100644
--- a/core/src/ch/asynk/tankontank/game/Unit.java
+++ b/core/src/ch/asynk/tankontank/game/Unit.java
@@ -199,15 +199,20 @@ public class Unit extends HeadedPawn
return (isEnemy(other) && canEngage());
}
+ public void setMoved()
+ {
+ hasMoved = true;
+ }
+
@Override
public void move()
{
TankOnTank.debug(movement.toString());
if (movement.cost > mpLeft) TankOnTank.debug("ERROR: Movement point exceeded: " + movement.cost + "/" + mpLeft + " please report");
- if (movement.isComplete()) {
- hasMoved = true;
- }
+ if (movement.isComplete())
+ setMoved();
+
mpLeft -= movement.cost;
}