fix: 修复最大总额计算错误的 bug

This commit is contained in:
chenkai 2023-12-22 20:13:18 +08:00
parent 7eb34f872d
commit bcca0ebbab

View File

@ -23,7 +23,7 @@ function randomWithWeight(groups: diamondWeightGroup[]) {
if (!maxAmount) {
maxAmount = group.numrange[1];
} else {
maxAmount = Math.min(maxAmount, group.numrange[1]);
maxAmount = Math.max(maxAmount, group.numrange[1]);
}
}
const randomValue = Math.random() * totalWeights; // 随机值落在[0, totalWeights) 之间