diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-07 23:35:08 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-07 23:35:08 +0200 |
commit | b4c304514291ecabb75821163d46b370a1c2290c (patch) | |
tree | 22ccb4ec915d2011f555ca40f6dab93fb6b1ea78 /core | |
parent | 8cf208a92b7d95fcee239413f4f6db8a067d6f8b (diff) | |
download | RustAndDust-b4c304514291ecabb75821163d46b370a1c2290c.zip RustAndDust-b4c304514291ecabb75821163d46b370a1c2290c.tar.gz |
Map: only hq can order moves
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Map.java | 16 |
1 files 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); |