Fix instant-win bug: first round no longer skipped when min-players is 1
Build / build (push) Successful in 1m15s
Build / build (push) Successful in 1m15s
This commit is contained in:
@@ -264,8 +264,15 @@ public class Arena {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void startNextRound() {
|
private void startNextRound() {
|
||||||
if (EliminationLogic.isMatchOver(players.size())) {
|
if (players.isEmpty()) {
|
||||||
endMatch(players.isEmpty() ? null : (players.isEmpty() ? null : players.get(0)));
|
endMatch(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Only treat "down to one player" as a win once at least one round has actually been
|
||||||
|
// played (round > 0). At round 0 (the very first round after the countdown), a single
|
||||||
|
// player is expected whenever min-players is configured as 1 for solo play/testing.
|
||||||
|
if (round > 0 && EliminationLogic.isMatchOver(players.size())) {
|
||||||
|
endMatch(players.get(0));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
round++;
|
round++;
|
||||||
|
|||||||
Reference in New Issue
Block a user