summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/game
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-09-22 12:50:06 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-09-22 12:50:06 +0200
commit67bdf07d706fff5d3070e841252e31cd144671b9 (patch)
tree8a12e2bfb4fc1b882502b43c0131265bfe4a30a4 /core/src/ch/asynk/tankontank/game
parentb2b836b8c7a6a5dc0dddf8e85502f4903d4f2686 (diff)
downloadRustAndDust-67bdf07d706fff5d3070e841252e31cd144671b9.zip
RustAndDust-67bdf07d706fff5d3070e841252e31cd144671b9.tar.gz
correctly manage dragged Pawn and pawnsToDraw
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index 9eef409..7271f22 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -27,7 +27,8 @@ public class Map extends Board
{
getHexAt(currentHex, x, y);
if (currentHex.x != -1) {
- currentPawn = getTopPawnAt(currentHex);
+ currentPawn = removeTopPawnFrom(currentHex);
+ if (currentPawn != null) pawnsToDraw.add(currentPawn);
}
}
@@ -35,6 +36,7 @@ public class Map extends Board
{
getHexAt(currentHex, x, y);
if (currentPawn != null) {
+ pawnsToDraw.remove(currentPawn);
movePawnTo(currentPawn, currentHex);
}
}