心愿抽卡,未选择心愿报错兼容,直接返回原本英雄
parent
ae47b63edd
commit
ecf41ec2b3
|
|
@ -586,12 +586,12 @@ public class HeroLogic {
|
|||
}
|
||||
}
|
||||
});
|
||||
// 全部抽中
|
||||
if (map.isEmpty()) {
|
||||
return item;
|
||||
}
|
||||
// 随机权重
|
||||
int weight = map.values().stream().mapToInt(Integer::intValue).sum();
|
||||
// 全部抽中
|
||||
if (map.isEmpty() || weight <= 0) {
|
||||
return item;
|
||||
}
|
||||
int randomInt = MathUtils.randomInt(weight);
|
||||
LOGGER.error("*************************************心愿抽奖权重,总权重:{},随机值:{},map:{}", weight, randomInt, map.toString());
|
||||
// 遍历权重
|
||||
|
|
|
|||
Loading…
Reference in New Issue