From c5ec3669fb3d7cada8b6cec513e1f2a3ab5c5f22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 16 Nov 2014 01:17:21 +0100 Subject: UnitDock: do not show if dock empty --- core/src/ch/asynk/tankontank/game/hud/UnitDock.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/ch/asynk/tankontank/game/hud/UnitDock.java b/core/src/ch/asynk/tankontank/game/hud/UnitDock.java index 4e78c32..0e67630 100644 --- a/core/src/ch/asynk/tankontank/game/hud/UnitDock.java +++ b/core/src/ch/asynk/tankontank/game/hud/UnitDock.java @@ -97,6 +97,8 @@ public class UnitDock extends Bg float x = position.getX(rect.width * SCALE); if (done) { pawns = ctrl.player.getReinforcement(); + if(pawns.size() == 0) + return; rect.width = pawns.get(0).getWidth() + (2 * padding); rect.height = ((pawns.get(0).getHeight() * pawns.size()) + ((pawns.size() + 1) * padding)); rect.x = (position.isLeft() ? (0 - (rect.width * SCALE)) : (x + (rect.width * SCALE))); -- cgit v1.1-2-g2b99