diff --git a/server/src/main/java/fr/lnl/game/server/games/grid/elements/Bomb.java b/server/src/main/java/fr/lnl/game/server/games/grid/elements/Bomb.java index 4053d40..a5cff21 100644 --- a/server/src/main/java/fr/lnl/game/server/games/grid/elements/Bomb.java +++ b/server/src/main/java/fr/lnl/game/server/games/grid/elements/Bomb.java @@ -27,16 +27,17 @@ public class Bomb extends Explosive implements CountdownBox { @Override public void update() { + Grid grid = game.getGrid(); counter--; if(counter == 0) { for(int i = -EXPLOSION_SIZE; i < EXPLOSION_SIZE; i++) { for(int j = -EXPLOSION_SIZE; j < EXPLOSION_SIZE; j++) { if(pythagoras(i, j) <= EXPLOSION_SIZE) { // recherche en cercle, pas en carré - Grid grid = game.getGrid(); Point position = new Point(point.getA() + i, point.getB() + j); if(position.getA() >= 0 && position.getA() < grid.getRow() && position.getB() >= 0 && position.getB() < grid.getColumn()) { - interact(grid, null, position); + Player player = grid.getBoard().get(position).getA(); + interact(grid, player, position); } } } diff --git a/server/src/main/java/fr/lnl/game/server/games/grid/elements/Explosive.java b/server/src/main/java/fr/lnl/game/server/games/grid/elements/Explosive.java index 2287608..dca0d3f 100644 --- a/server/src/main/java/fr/lnl/game/server/games/grid/elements/Explosive.java +++ b/server/src/main/java/fr/lnl/game/server/games/grid/elements/Explosive.java @@ -8,6 +8,8 @@ public abstract class Explosive extends AbstractBox implements InteractiveBox { @Override public void interact(Grid grid, Player player, Point position) { - grid.getBoard().get(position).setB(null); + if(grid.getBoard().get(position).getB() == this){ + grid.getBoard().get(position).setB(null); + } } }