From 182b0806bfa7d13ff3e79a99b876122fe9cd1219 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Thu, 7 Apr 2016 15:23:50 +0200 Subject: Fix bomb drop event filtering --- src/ch/epfl/xblast/server/GameState.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/ch/epfl') diff --git a/src/ch/epfl/xblast/server/GameState.java b/src/ch/epfl/xblast/server/GameState.java index 3495af1..36709e9 100644 --- a/src/ch/epfl/xblast/server/GameState.java +++ b/src/ch/epfl/xblast/server/GameState.java @@ -248,8 +248,7 @@ public final class GameState { * @return the newly dropped bombs */ private static List newlyDroppedBombs(List players0, Set bombDropEvents, List bombs0) { - Set bombedCells = GameState.bombedCells(bombs0).keySet(); - + HashSet bombedCells = new HashSet<>(GameState.bombedCells(bombs0).keySet()); List bombs1 = new ArrayList<>(); for (Player p : GameState.alivePlayers(players0)) { @@ -511,7 +510,7 @@ public final class GameState { private Set discardConflictingBombDropEvents(Set bombDropEvents) { Map bombDropMap = this.mapTopPriorityPlayerCells( this.alivePlayers().stream() - .filter(bombDropEvents::contains) + .filter(p -> bombDropEvents.contains(p.id())) .collect(Collectors.toList()) ); -- cgit v1.2.3