From 1283a2efac37c95016224dd832ebac81ce8a99d7 Mon Sep 17 00:00:00 2001 From: JBM Date: Mon, 8 Jun 2020 12:05:19 +0200 Subject: [PATCH] Hotfix: (from @pb4) a dead player isn't granted an early termination This is an unfortunate consequence of the migration to multiround: I can't count on gameManager.getActivePlayers() anymore since I don't deactivate players simply for losing a round. I'm getting closer and closer to wrapping GameManager. --- src/main/java/com/codingame/game/Referee.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/codingame/game/Referee.java b/src/main/java/com/codingame/game/Referee.java index dfa3324..3aef88d 100644 --- a/src/main/java/com/codingame/game/Referee.java +++ b/src/main/java/com/codingame/game/Referee.java @@ -172,6 +172,8 @@ public class Referee extends AbstractReferee { boolean noStones = true; int delta = 0; for (Player player : gameManager.getActivePlayers()) { + if (model.haveWinner() && player.getIndex() == model.getLoser()) + continue; player.stoneThrow = player.model.getStones(); player.model.setStones(0); delta += player.stoneThrow * player.model.getMultiplier(); -- 2.30.2