变身卡消耗bug

back_recharge
duhui 2022-09-07 14:04:03 +08:00
parent cb2581e5fc
commit 6ee2ba5d88
1 changed files with 2 additions and 1 deletions

View File

@ -95,7 +95,8 @@ public class TransformationUpGradeHandler extends BaseHandler<HeroInfoProto.Tran
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
}
}
if(costMap.values().size() < num){
int sum = costMap.values().stream().mapToInt(Integer::intValue).sum();
if(sum != num){
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
}
if (!ItemUtil.itemCost(user, costMap, BIReason.TRANSFORMATION_CARD_STAR_COST, 1)) {