From b4c304514291ecabb75821163d46b370a1c2290c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 7 Oct 2014 23:35:08 +0200 Subject: Map: only hq can order moves --- core/src/ch/asynk/tankontank/game/Map.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index 8751a87..869d7e7 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -124,13 +124,15 @@ public abstract class Map extends Board enableMoveAssist(false); moveAssist.clear(); buildNeighbours(hex); - for (int i = 0; i < 6; i++) { - GridPoint2 neighbour = neighbours[i]; - Hex h = getHexSafe(neighbour); - if (h != null) { - Pawn p = h.getTopPawn(); - if ((p != null) && (!pawn.isEnemy(p))) - moveAssist.add(neighbour); + if (pawn.isHq()) { + for (int i = 0; i < 6; i++) { + GridPoint2 neighbour = neighbours[i]; + Hex h = getHexSafe(neighbour); + if (h != null) { + Pawn p = h.getTopPawn(); + if ((p != null) && (!pawn.isEnemy(p))) + moveAssist.add(neighbour); + } } } enableMoveAssist(true); -- cgit v1.1-2-g2b99