summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-01-19 11:46:26 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-01-19 11:46:26 +0100
commit4550f30ed838c61a0ba4db8c6db02c94ed477ee9 (patch)
tree3c376dcce163b45498bbdfde5736af465e44334a /core/src/ch/asynk/tankontank
parentd6454053de6941d08b66c131f0d06ea9a11ae5f0 (diff)
downloadRustAndDust-4550f30ed838c61a0ba4db8c6db02c94ed477ee9.zip
RustAndDust-4550f30ed838c61a0ba4db8c6db02c94ed477ee9.tar.gz
Board: findBestEntry must use opposite Orientation to compute costs and roadmap on to
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Board.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java
index 6cd2053..350be95 100644
--- a/core/src/ch/asynk/tankontank/engine/Board.java
+++ b/core/src/ch/asynk/tankontank/engine/Board.java
@@ -357,6 +357,7 @@ public abstract class Board implements Disposable, Animation
if (t.isOffMap()) {
Orientation o = Orientation.fromAdj(t.col, t.row, to.col, to.row);
if (o.isInSides(allowedMoves)) {
+ o = o.opposite();
boolean r = to.road(o);
int c = to.costFrom(pawn, o);
if ((c < cost) || (r && (c == cost))) {