From b149e757362d29c01563a914c4e43d62128a3684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 4 Nov 2014 16:17:25 +0100 Subject: UnitDock: do not hit when not visible --- core/src/ch/asynk/tankontank/game/hud/UnitDock.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/ch/asynk/tankontank/game/hud/UnitDock.java b/core/src/ch/asynk/tankontank/game/hud/UnitDock.java index c90ae81..49189f2 100644 --- a/core/src/ch/asynk/tankontank/game/hud/UnitDock.java +++ b/core/src/ch/asynk/tankontank/game/hud/UnitDock.java @@ -73,7 +73,7 @@ public class UnitDock extends Bg @Override public boolean hit(float x, float y) { - if (scaledRect.contains(x, y)) { + if (visible && scaledRect.contains(x, y)) { int i = (int) ((scaledRect.y + scaledRect.height - y) / (scaledRect.height / pawns.size())); selectedPawn = pawns.get(i); return true; -- cgit v1.1-2-g2b99