summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-11-11 21:26:50 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-11-11 21:26:50 +0100
commit5ebb6356cff2f391652ff25abb34c83f1e6903fc (patch)
tree1e8b805ed964d2f9cecba38976e8f0ac99197627 /core/src/ch
parent289db294f15c5afb2eee1d4c991a78ebf5ff0e6a (diff)
downloadRustAndDust-5ebb6356cff2f391652ff25abb34c83f1e6903fc.zip
RustAndDust-5ebb6356cff2f391652ff25abb34c83f1e6903fc.tar.gz
UnitDock: recompute reinforcement units in dock if player change
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/rustanddust/game/hud/UnitDock.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/hud/UnitDock.java b/core/src/ch/asynk/rustanddust/game/hud/UnitDock.java
index 9a7811e..c249c64 100644
--- a/core/src/ch/asynk/rustanddust/game/hud/UnitDock.java
+++ b/core/src/ch/asynk/rustanddust/game/hud/UnitDock.java
@@ -158,9 +158,11 @@ public class UnitDock extends Bg implements Animation
n = 0;
return false;
}
- if (count == n) return true;
- n = count;
+ if ((count == n) && (units == ctrl.player.reinforcement))
+ return true;
+
+ n = count;
units = ctrl.player.reinforcement;
rect.width = units.get(0).getWidth() + (2 * padding);
rect.height = ((units.get(0).getHeight() * n) + ((n + 1) * padding));