diff options
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/Piece.java | 5 | ||||
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/Piece.java b/core/src/ch/asynk/gdx/boardgame/Piece.java index 6944afc..5f47309 100644 --- a/core/src/ch/asynk/gdx/boardgame/Piece.java +++ b/core/src/ch/asynk/gdx/boardgame/Piece.java @@ -134,4 +134,9 @@ public class Piece implements Drawable, Positionable, Rotable, Scalable // Integer.MAX_VALUE means impracticable return Integer.MAX_VALUE; } + + public boolean atLeastOneTileMove() + { + return true; + } } diff --git a/core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java b/core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java index 639741e..e04f91e 100644 --- a/core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java +++ b/core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java @@ -492,7 +492,7 @@ public class HexBoard implements Board if (cost == Integer.MAX_VALUE) continue; // impracticable int r = src.acc - cost; - if (r < 0 && src != from) continue; // allow at least 1 tile move + if (r < 0 && !(src == from && piece.atLeastOneTileMove())) continue; // allow at least 1 tile move if (dst.searchCount != searchCount) { dst.searchCount = searchCount; |