Skip to content

Commit

Permalink
Fix song battle medal counts (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
camero2734 authored Jul 8, 2024
1 parent 3f2933f commit 6abec04
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/InteractionEntrypoints/scheduled/songbattle.consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,11 @@ export async function determineNextMatchup(): Promise<{
const totalMatches = NUMBER_OF_ELIMINATIONS * (histories.size - 1) + numTies + fewestEliminations;

// The number of times the songs have gone before
const song1Wins = histories.get(song1Id)?.rounds || 0;
const song2Wins = histories.get(song2Id)?.rounds || 0;
const song1Hist = histories.get(song1Id);
const song2Hist = histories.get(song2Id);

const song1Wins = song1Hist ? song1Hist.rounds - song1Hist.eliminations : 0;
const song2Wins = song2Hist ? song2Hist.rounds - song2Hist.eliminations : 0;

return { song1, song2, song1Wins, song2Wins, album1, album2, nextBattleNumber: previousBattlesRaw.length + 1, result, totalMatches };
}

0 comments on commit 6abec04

Please sign in to comment.