From d4a2b34687c0a81596cd8d5b7c882e9b935c384d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sat, 15 Nov 2014 16:41:08 +0100 Subject: Unit: add setMoved() to mark it unconditionally --- core/src/ch/asynk/tankontank/game/Unit.java | 11 ++++++++--- 1 file 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; } -- cgit v1.1-2-g2b99