From 3c7ddc37001bd45522ff78778ea7fcd12b02e3f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 18 Feb 2015 18:30:14 +0100 Subject: Tile: do not push twice the same unit --- core/src/ch/asynk/tankontank/engine/Tile.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 public int push(Pawn pawn) { - stack.push(pawn); + if (!stack.contains(pawn)) + stack.push(pawn); return stack.size(); } -- cgit v1.1-2-g2b99