summaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-05-25 23:12:46 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2020-05-25 23:12:46 +0200
commit597ed977280986e52b73dcf64539199274e4f4d4 (patch)
tree390d148c334e6f31328324736a7cdfdd3f28c9f1 /test/src
parentdd9e1f7d7c2744f6a67e988d5335e19b08826e30 (diff)
downloadgdx-boardgame-597ed977280986e52b73dcf64539199274e4f4d4.zip
gdx-boardgame-597ed977280986e52b73dcf64539199274e4f4d4.tar.gz
BoardScreen : show adjacent on reset, do not crash
Diffstat (limited to 'test/src')
-rw-r--r--test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java b/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java
index 086133d..a5ec9f9 100644
--- a/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java
+++ b/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java
@@ -60,8 +60,10 @@ public class BoardScreen extends AbstractScreen
public void reset()
{
- pos.set(0, 0);
tilesToDraw.clear();
+ v.set(0, 0);
+ pos.set(0, 0);
+ handleAdjacents();
board.centerOf(0, 0, v);
panzer.centerOn(v.x, v.y);
panzer.setRotation(Orientation.DEFAULT.r());
@@ -108,6 +110,7 @@ public class BoardScreen extends AbstractScreen
private Tile getTile(int x, int y)
{
+ if (!board.isOnMap(x, y)) return null;
return tileStorage.getTile(x, y, board::genKey, this::buildTile);
}