Skip to content

Commit a6e3aba

Browse files
committed
1 parent f3dcd23 commit a6e3aba

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/main/java/fr/hugman/build_rush/game/state/BRActive.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -749,15 +749,20 @@ public int calcPlayerScore(PlayerData playerData) {
749749

750750
public void calcLastPlayer() {
751751
int fewestScore = Integer.MAX_VALUE;
752+
int scoreCount = 0;
752753
UUID uuid = null;
753754
for (var u : this.playerDataMap.keySet()) {
754755
var d = this.playerDataMap.get(u);
755756
if (d != null && !d.eliminated && d.score <= fewestScore) {
756-
fewestScore = d.score;
757-
uuid = u;
757+
if (d.score < fewestScore) {
758+
fewestScore = d.score;
759+
uuid = u;
760+
scoreCount = 0;
761+
}
762+
scoreCount += 1;
758763
}
759764
}
760-
if (fewestScore == this.maxScore) {
765+
if (fewestScore == this.maxScore || (scoreCount > 1 && fewestScore > 0)) {
761766
this.loserUuid = null;
762767
return;
763768
}

0 commit comments

Comments
 (0)