Fix weight not properly

This commit is contained in:
Ajay Ramachandran 2020-07-23 23:34:31 -04:00
parent 4ab827da06
commit b6dd109fcb

View file

@ -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);
}