diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-04-22 00:00:26 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-04-22 00:00:26 +0200 |
commit | 6474c32671efae0bc9ebd04081ec1d4590796029 (patch) | |
tree | db452e7df93173c711931d2d41f96f29b255c617 /core/src/ch/asynk/rustanddust/game | |
parent | f005415f8e20528abd886605f74590039d34220f (diff) | |
download | RustAndDust-6474c32671efae0bc9ebd04081ec1d4590796029.zip RustAndDust-6474c32671efae0bc9ebd04081ec1d4590796029.tar.gz |
Unit: if roadMarch deduce bonus from move cost, cost is at least 1
Diffstat (limited to 'core/src/ch/asynk/rustanddust/game')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Unit.java | 5 |
1 files 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"); |