diff --git a/serverlogic/src/main/java/com/ljsd/jieling/util/ItemUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/util/ItemUtil.java index 90e75db6e..f12a8f844 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/util/ItemUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/util/ItemUtil.java @@ -91,7 +91,7 @@ public class ItemUtil { private static void maptoAddWithOutItem(User user, ItemMap itemObj, CommonProto.Drop.Builder dropBuilder,int reason) throws Exception { addCard(user, itemObj.getCardMap(), dropBuilder,reason); addEquip(user, itemObj.getEquipMap(), dropBuilder,reason); -// addSpecialMonster(user,itemObj,dropBuilder,reason); + addSpecialMonster(user,itemObj,dropBuilder,reason); } @@ -178,7 +178,6 @@ public class ItemUtil { ItemMap itemObj = new ItemMap(); selectLongItemArr(itemArr,itemObj); -// useRandomItem(user,randomMap,reason); int ints = addItemByMail(user, itemObj.getItemMap(), dropBuilder, reason); maptoAddWithOutItem(user,itemObj,dropBuilder,reason); return ints; @@ -1595,10 +1594,7 @@ public class ItemUtil { } Item item = user.getItemManager().getItem(key); if (item == null) { - if(value==0){ - return true; - } - return false; + return value == 0; } if (value < 0) { LOGGER.info("checkCost uid=>{} use negative item itemId=>{} count=>{}", user.getId(), key, value); @@ -1650,12 +1646,8 @@ public class ItemUtil { int itemNum = costItem[1]*times; SItem sItem = SItem.getsItemMap().get(itemId); int itemType = getItemType(sItem); - switch (itemType) { - case GlobalItemType.ITEM: - putCountMap(itemId,itemNum,itemMap); - break; - default: - break; + if (itemType == GlobalItemType.ITEM) { + putCountMap(itemId, itemNum, itemMap); } } } @@ -1762,11 +1754,7 @@ public class ItemUtil { public static boolean fightItemCost(User user,int[][] costItems) throws Exception { Map itemMap = new HashMap<>(); selectCost(costItems,itemMap); - boolean result = checkCost(user, itemMap); - if (!result) { - return false; - } - return true; + return checkCost(user, itemMap); } /** @@ -1811,7 +1799,7 @@ public class ItemUtil { * @param itemArr * @return */ - public static int checkCardAndEquipLimit( User user ,long[][] itemArr) { + public static int checkCardAndEquipLimit(User user ,long[][] itemArr) { int result = 0; SGameSetting gameSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting();