summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-13 01:18:14 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-13 01:18:14 +0200
commit30062c1458b1cca83b91587cb2239d2378374c83 (patch)
treebfee107fc6f2f19a7c960c5505fb5a65466b00d9 /core/src/ch/asynk/tankontank
parent1bc539674a7976d5a90675c3b83278135ecd468b (diff)
downloadRustAndDust-30062c1458b1cca83b91587cb2239d2378374c83.zip
RustAndDust-30062c1458b1cca83b91587cb2239d2378374c83.tar.gz
Board: fix buildAttackAssists(), use Pawn.getCenter() instead of pawn.getPosition()
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Board.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java
index 8142fab..ea1fb1c 100644
--- a/core/src/ch/asynk/tankontank/engine/Board.java
+++ b/core/src/ch/asynk/tankontank/engine/Board.java
@@ -353,7 +353,7 @@ public abstract class Board implements Disposable
if ((p == pawn) || !p.canAttack()) continue;
if (from == null)
from = gridPoint2Pool.obtain();
- getHexAt(p.getPosition(), from);
+ getHexAt(p.getCenter(), from);
if (searchBoard.canAttack(p, from.x, from.y, hex.x, hex.y)) {
assists.add(from);
from = null;
@@ -584,6 +584,12 @@ public abstract class Board implements Disposable
return getHexAt(null, v.x, v.y);
}
+ public GridPoint2 getHexAt(Vector2 v, GridPoint2 hex)
+ {
+ if (v == null) return null;
+ return getHexAt(hex, v.x, v.y);
+ }
+
public GridPoint2 getHexAt(Vector3 v)
{
if (v == null) return null;