summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-16 17:15:02 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-16 17:15:02 +0200
commitecfa74945c740542d5d4bb488b6c084af929a377 (patch)
tree3be8a58033584afdf7a87fa4ebfa5fab883cdcb4 /core
parent0fde9414d978791f136cfb7bfc73cd125853810f (diff)
downloadRustAndDust-ecfa74945c740542d5d4bb488b6c084af929a377.zip
RustAndDust-ecfa74945c740542d5d4bb488b6c084af929a377.tar.gz
StateSelect: fix buildPossiblesTargets call when select Pawn is an enemy
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateSelect.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/StateSelect.java b/core/src/ch/asynk/tankontank/game/states/StateSelect.java
index 556148c..8ff3bcd 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateSelect.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateSelect.java
@@ -53,7 +53,11 @@ public class StateSelect extends StateCommon
if (hasPawn() && (!isEnemy || ctrl.cfg.showEnemyPossibilities)) {
int moves = map.buildPossibleMoves(selectedPawn, selectedHex);
- int targets = map.buildPossibleTargets(selectedPawn, selectedHex, ctrl.otherPlayer().unitIterator());
+ int targets = 0;
+ if (isEnemy)
+ targets = map.buildPossibleTargets(selectedPawn, selectedHex, ctrl.currentPlayer().unitIterator());
+ else
+ targets = map.buildPossibleTargets(selectedPawn, selectedHex, ctrl.otherPlayer().unitIterator());
int assists = map.buildMoveAssists(selectedPawn, selectedHex);
showPossibleTargetsMovesAssists(selectedPawn);
ctrl.hud.show(