From 70f3b3c7077050bb297b67f42adc5b9987ddc473 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Mon, 24 Apr 2023 17:57:08 +1000 Subject: [PATCH] state: Fixed majorities bug --- src/comp1110/ass2/State.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/comp1110/ass2/State.java b/src/comp1110/ass2/State.java index a2c4d0c..7d74c94 100644 --- a/src/comp1110/ass2/State.java +++ b/src/comp1110/ass2/State.java @@ -487,7 +487,7 @@ public class State { } if (playerPieces[i] == playerPieces[playerID]) ties++; } - if (ishighest) { + if (ishighest && playerPieces[playerID] > 0) { if (ties > 0){ score += island.getBonus()/(ties + 1); }