diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-21 23:50:56 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-21 23:50:56 +0100 |
commit | f6cc188a1b58f65479d86a43255668ddc673aa70 (patch) | |
tree | b7cebd35850f47c8dc3c2602c9ff9cedea6e423f /core/src/ch/asynk/tankontank | |
parent | 575e91afd929dfd12ffd1eec70b468f22450746b (diff) | |
download | RustAndDust-f6cc188a1b58f65479d86a43255668ddc673aa70.zip RustAndDust-f6cc188a1b58f65479d86a43255668ddc673aa70.tar.gz |
PathBuilder: setExit() do not add a tile in path if to==from
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/PathBuilder.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/PathBuilder.java b/core/src/ch/asynk/tankontank/engine/PathBuilder.java index a227b01..f3ebb87 100644 --- a/core/src/ch/asynk/tankontank/engine/PathBuilder.java +++ b/core/src/ch/asynk/tankontank/engine/PathBuilder.java @@ -239,8 +239,10 @@ public class PathBuilder implements Disposable { orientation = o; Path path = getPath(0); - path.cost += 1; - path.tiles.add(to); + if (from != to) { + path.cost += 1; + path.tiles.add(to); + } to = board.getAdjTileAt(to, o); } |