修改合成限制为只限制英雄

master_otnew
grimm 2024-01-02 11:43:05 +08:00
parent ea310891c5
commit f55d9f3cd6
1 changed files with 9 additions and 7 deletions

View File

@ -3826,7 +3826,7 @@ public class HeroLogic {
} }
/** /**
* , * ,,
* *
* @param iSession * @param iSession
* @param item * @param item
@ -3843,6 +3843,7 @@ public class HeroLogic {
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
} }
int composeNum = itemNum / sItem.getUsePerCount(); int composeNum = itemNum / sItem.getUsePerCount();
if (sItem.getItemType() == GlobalItemType.CARD){
SGameSetting gameSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting(); SGameSetting gameSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting();
if (composeNum <= 0 || composeNum > gameSetting.getHeroCompoundLimit()) { if (composeNum <= 0 || composeNum > gameSetting.getHeroCompoundLimit()) {
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
@ -3850,6 +3851,7 @@ public class HeroLogic {
if (hasHeroNum + composeNum > gameSetting.getHeroNumlimit()) { if (hasHeroNum + composeNum > gameSetting.getHeroNumlimit()) {
throw new ErrorCodeException(ErrorCode.HERO_HERO_MAX); throw new ErrorCodeException(ErrorCode.HERO_HERO_MAX);
} }
}
boolean result = ItemUtil.checkCost(user, sItem, itemNum, BIReason.COMPOS_HERO_CONSUME, itemId); boolean result = ItemUtil.checkCost(user, sItem, itemNum, BIReason.COMPOS_HERO_CONSUME, itemId);
if (!result) { if (!result) {
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH); throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);