From 6474c32671efae0bc9ebd04081ec1d4590796029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 22 Apr 2016 00:00:26 +0200 Subject: Unit: if roadMarch deduce bonus from move cost, cost is at least 1 --- core/src/ch/asynk/rustanddust/game/Unit.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/game/Unit.java b/core/src/ch/asynk/rustanddust/game/Unit.java index 8ee6e68..e415ee3 100644 --- a/core/src/ch/asynk/rustanddust/game/Unit.java +++ b/core/src/ch/asynk/rustanddust/game/Unit.java @@ -296,9 +296,10 @@ public class Unit extends HeadedPawn public void move() { int cost = move.cost; - - if (move.roadMarch && (cost > mpLeft)) + if (move.roadMarch) { cost -= getRoadMarchBonus(); + if (cost < 1) cost = 1; + } if (cost > mpLeft) RustAndDust.debug("ERROR: Movement point exceeded: " + cost + "/" + mpLeft + " please report"); -- cgit v1.1-2-g2b99