diff options
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Player.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Player.java b/core/src/ch/asynk/tankontank/game/Player.java index ffca1a2..9bc1c2b 100644 --- a/core/src/ch/asynk/tankontank/game/Player.java +++ b/core/src/ch/asynk/tankontank/game/Player.java @@ -205,17 +205,16 @@ public class Player return false; } - public Unit promote(Unit unit) + public boolean promote(Unit unit) { for (Unit p: casualties) { if (p.isHqOf(unit)) { - units.remove(unit); - casualties.add(unit); - units.add(p); - casualties.remove(p); - return p; + unit.promote(); + p.degrade(); + return true; } } - return null; + + return false; } } |