summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-04-22 00:00:26 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2016-04-22 00:00:26 +0200
commit6474c32671efae0bc9ebd04081ec1d4590796029 (patch)
treedb452e7df93173c711931d2d41f96f29b255c617 /core/src/ch/asynk
parentf005415f8e20528abd886605f74590039d34220f (diff)
downloadRustAndDust-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')
-rw-r--r--core/src/ch/asynk/rustanddust/game/Unit.java5
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");