diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-02-18 18:30:14 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-02-18 18:30:14 +0100 |
commit | 3c7ddc37001bd45522ff78778ea7fcd12b02e3f6 (patch) | |
tree | 99ae56705b951d388bd46813b567b2de03b3e395 /core | |
parent | 515b5166127b936c162f918d057c9f94bcba458d (diff) | |
download | RustAndDust-3c7ddc37001bd45522ff78778ea7fcd12b02e3f6.zip RustAndDust-3c7ddc37001bd45522ff78778ea7fcd12b02e3f6.tar.gz |
Tile: do not push twice the same unit
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Tile.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Tile.java b/core/src/ch/asynk/tankontank/engine/Tile.java index 2939ef8..e776473 100644 --- a/core/src/ch/asynk/tankontank/engine/Tile.java +++ b/core/src/ch/asynk/tankontank/engine/Tile.java @@ -90,7 +90,8 @@ public abstract class Tile implements Drawable, Disposable, Iterable<Pawn> public int push(Pawn pawn) { - stack.push(pawn); + if (!stack.contains(pawn)) + stack.push(pawn); return stack.size(); } |