diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-16 17:15:02 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-16 17:15:02 +0200 |
commit | ecfa74945c740542d5d4bb488b6c084af929a377 (patch) | |
tree | 3be8a58033584afdf7a87fa4ebfa5fab883cdcb4 | |
parent | 0fde9414d978791f136cfb7bfc73cd125853810f (diff) | |
download | RustAndDust-ecfa74945c740542d5d4bb488b6c084af929a377.zip RustAndDust-ecfa74945c740542d5d4bb488b6c084af929a377.tar.gz |
StateSelect: fix buildPossiblesTargets call when select Pawn is an enemy
-rw-r--r-- | core/src/ch/asynk/tankontank/game/states/StateSelect.java | 6 |
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( |