Skip to content

Commit

Permalink
set round count for swiss
Browse files Browse the repository at this point in the history
  • Loading branch information
slashinfty committed Oct 17, 2023
1 parent f0565a1 commit 8b40c58
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tournament-organizer",
"version": "3.3.0",
"version": "3.3.1",
"description": "JavaScript library for running tournaments",
"exports": {
".": {
Expand Down
2 changes: 1 addition & 1 deletion src/Tournament.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ export class Tournament {
this.#createMatches(players);
if (this.stageOne.format === 'swiss' && this.stageOne.rounds === 0) {
this.stageOne.rounds = Math.ceil(Math.log2(this.players.length));
} else {
} else if (this.stageOne.format !== 'swiss') {
this.stageOne.rounds = this.matches.reduce((max, curr) => Math.max(max, curr.round), 0);
}
}
Expand Down

0 comments on commit 8b40c58

Please sign in to comment.