特权修复

back_recharge
duhui 2022-09-16 10:44:17 +08:00
parent caee7ba2a1
commit 286d9a3f34
1 changed files with 8 additions and 9 deletions

View File

@ -314,15 +314,14 @@ public class HeroLogic {
//检测是否有折扣
if (sLotterySetting.getDiscountTimes() != 0) {
List<SPrivilegeTypeConfig> missingType = SPrivilegeTypeConfig.privilegeByType.get(sLotterySetting.getDiscountTimes());
Arrays.stream(costItems).forEach(n -> {
for (SPrivilegeTypeConfig config : missingType) {
if (user.getPlayerInfoManager().containPrivilageId(config.getId())) {
int privigeValue = PlayerLogic.getInstance().getMaxCountByPrivilegeType(user, config.getType());
n[1] = (int) (n[1] / 10000d * (10000 + privigeValue));
}
}
}
);
for (int[] n : costItems) {
for (SPrivilegeTypeConfig config : missingType) {
if (user.getPlayerInfoManager().containPrivilageId(config.getId())) {
int privigeValue = PlayerLogic.getInstance().getMaxCountByPrivilegeType(user, config.getPrivilegeType());
n[1] = (int) (n[1] / 10000d * (10000 + privigeValue));
}
}
}
}
}
enoughCost = ItemUtil.itemCost(user, costItems, BIReason.RANDOM_HERO_CONSUME, type);