diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2020-05-25 23:12:46 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2020-05-25 23:12:46 +0200 |
commit | 597ed977280986e52b73dcf64539199274e4f4d4 (patch) | |
tree | 390d148c334e6f31328324736a7cdfdd3f28c9f1 /test/src | |
parent | dd9e1f7d7c2744f6a67e988d5335e19b08826e30 (diff) | |
download | gdx-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.java | 5 |
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); } |