Skip to content

Commit

Permalink
ffrace bug correction in estimated position in case of equality
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixLusseau committed May 1, 2024
1 parent c189405 commit 17f253b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions commands/ffrace.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,12 @@ async function ffrace(bot, api, interaction, channel, clan, report) {

// Calculate the estimated position of the clan
for (let i = 0; i < dataArray.length; i++) {
if (i > 0 && dataArray[i][1].estimate == dataArray[i - 1][1].estimate)
if (i > 0 && dataArray[i][1].estimate == dataArray[i - 1][1].estimate) {
sortedData[dataArray[i][0]].estimatedPosition = sortedData[dataArray[i - 1][0]].estimatedPosition
continue
}
else
sortedData[dataArray[i][0]].estimatedPosition = i + 1

switch (sortedData[dataArray[i][0]].estimatedPosition) {
case 1:
sortedData[dataArray[i][0]].estimatedPosition = "1st"
Expand Down

0 comments on commit 17f253b

Please sign in to comment.