From 5ebb6356cff2f391652ff25abb34c83f1e6903fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 11 Nov 2015 21:26:50 +0100 Subject: UnitDock: recompute reinforcement units in dock if player change --- core/src/ch/asynk/rustanddust/game/hud/UnitDock.java | 6 ++++-- 1 file 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)); -- cgit v1.1-2-g2b99