From 107798bfd37366cabf86c42e5e4792c150505b7d Mon Sep 17 00:00:00 2001 From: Filip Szepielewicz Date: Sun, 6 Oct 2024 20:15:16 +0000 Subject: [PATCH] Update BattleState.java --- .../src/main/java/pp/battleship/game/client/BattleState.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Projekte/battleship/model/src/main/java/pp/battleship/game/client/BattleState.java b/Projekte/battleship/model/src/main/java/pp/battleship/game/client/BattleState.java index fa8d731..bd866ab 100644 --- a/Projekte/battleship/model/src/main/java/pp/battleship/game/client/BattleState.java +++ b/Projekte/battleship/model/src/main/java/pp/battleship/game/client/BattleState.java @@ -60,7 +60,7 @@ class BattleState extends ClientState { if (destroyedOpponentShip(msg)) logic.getOpponentMap().add(msg.getDestroyedShip()); if (msg.isGameOver()) { - msg.getRemainingOpponentShips().forEach(logic.getOwnMap()::add); + msg.getRemainingOpponentShips().forEach(logic.getOpponentMap()::add); logic.setState(new GameOverState(logic)); } } @@ -100,3 +100,6 @@ class BattleState extends ClientState { logic.playSound(Sound.DESTROYED_SHIP); } } + + +