From 70454c52445b797efc2384b92d6992aea3779ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sat, 22 Nov 2014 20:06:25 +0100 Subject: StateEngage: hit target to launch attack --- core/src/ch/asynk/tankontank/game/states/StateEngage.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/ch/asynk/tankontank/game/states/StateEngage.java b/core/src/ch/asynk/tankontank/game/states/StateEngage.java index 14465cc..fb83080 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateEngage.java +++ b/core/src/ch/asynk/tankontank/game/states/StateEngage.java @@ -93,8 +93,10 @@ public class StateEngage extends StateCommon map.showAttackAssists(); ctrl.hud.actionButtons.show(Buttons.ENGAGE.b | Buttons.DONE.b | ((ctrl.cfg.canCancel) ? Buttons.ABORT.b : 0)); } - - if ((activeUnit != null) && map.engagementAssists.contains(unit)) { + else if (unit == activeUnit) { + ctrl.setState(StateType.DONE); + } + else if ((activeUnit != null) && map.engagementAssists.contains(unit)) { if(map.toggleAttackAssist(unit)) ctrl.hud.notify(unit + " will fire"); else -- cgit v1.1-2-g2b99