summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateEngage.java6
1 files 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 c1903bd..048dbef 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateEngage.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateEngage.java
@@ -79,8 +79,10 @@ public class StateEngage extends StateCommon
{
Unit unit = upHex.getUnit();
- // activeUnit is the target
- if ((activeUnit == null) && map.possibleTargets.contains(unit)) {
+ // activeUnit is the target, selectedTarget is the engagement leader
+ if (unit == selectedUnit) {
+ ctrl.setState(StateType.ABORT);
+ } else if ((activeUnit == null) && map.possibleTargets.contains(unit)) {
// ctrl.hud.notify("Engage " + unit);
map.hidePossibleTargets();
to = upHex;