mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 09:07:47 +01:00
Fix weight not properly
This commit is contained in:
parent
4ab827da06
commit
b6dd109fcb
1 changed files with 1 additions and 0 deletions
|
@ -43,6 +43,7 @@ function getWeightedRandomChoice(choices, amountOfChoices) {
|
|||
|
||||
//add it to the chosen ones and remove it from the choices before the next iteration
|
||||
chosen.push(choices[i]);
|
||||
totalWeight -= choices[i].weight;
|
||||
choices.splice(i, 1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue