summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-23 22:19:34 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-23 22:19:34 +0100
commit0fbe2d7d1dd29762d48c06e7908df6d0b9029cd2 (patch)
treead919efee93dcb62a98d2133816e1ab547b08b73 /core
parent95016312a86c742e76f630aab2af5e64ceed327b (diff)
downloadRustAndDust-0fbe2d7d1dd29762d48c06e7908df6d0b9029cd2.zip
RustAndDust-0fbe2d7d1dd29762d48c06e7908df6d0b9029cd2.tar.gz
Map: leaveBoard: removePawn and if entryMove: revert objectives, and reset unit
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index 537a48f..398ded0 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -214,8 +214,11 @@ public abstract class Map extends Board
public void leaveBoard(Unit unit)
{
Hex hex = unit.getHex();
- if (removePawn(unit) == 0)
- objectives.unclaim(hex);
+ if (unit.movement.entryMove) {
+ objectives.revert();
+ unit.reset();
+ }
+ removePawn(unit);
activatedUnits.add(unit);
}