diff options
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 5 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Map.java | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index 2986002..7e0f9da 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -175,6 +175,11 @@ public abstract class Pawn implements Moveable, Disposable return (attack.isClear && attack.isFlank); } + public int attackDistance() + { + return attack.distance; + } + public Tile getTile() { return tile; diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index c19ee62..2ef7749 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -489,9 +489,8 @@ public abstract class Map extends Board implements MoveToAnimationCb, ObjectiveS if (assist.isA(Unit.UnitType.INFANTRY)) terrainBonus = false; if (night) { - int d = distance(assist.getTile(), target.getTile()); - if (d > distance) - distance = d; + if (distance < assist.attackDistance()) + distance = assist.attackDistance(); } } |