diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/mapType/TowerMap.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/mapType/TowerMap.java index 14bf88cb5..9b8424603 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/mapType/TowerMap.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/mapType/TowerMap.java @@ -627,10 +627,6 @@ public class TowerMap extends AbstractMap { if(mapManager.getTrialInfo().getEnergy()==-1){ throw new ErrorCodeException(ErrorCode.USE_BOMB_BOSS); } - boolean isUse = ItemUtil.itemCost(user,bomb,BIReason.BOMB_CONSUME,mapManager.getCurMapId()); - if(!isUse){ - throw new ErrorCodeException(ErrorCode.USE_BOMB_NO_BOSS); - } Map sEventPointConfig = STableManager.getConfig(SEventPointConfig.class); Set destoryCell = new HashSet<>(); Map configMap = MapPointConfig.scMapEventMap; @@ -656,6 +652,14 @@ public class TowerMap extends AbstractMap { destoryCell.add(entry.getValue().getPointId()); } } + if(monsterAmount==0){ + //没有小怪,无需使用炸弹 + throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); + } + boolean isUse = ItemUtil.itemCost(user,bomb,BIReason.BOMB_CONSUME,mapManager.getCurMapId()); + if(!isUse){ + throw new ErrorCodeException(ErrorCode.USE_BOMB_NO_BOSS); + } LOGGER.info("几种:{}",mapInfo.size()); int[] x = Arrays.stream(destoryCell.toArray(new Integer[destoryCell.size()])).mapToInt(Integer::valueOf).toArray(); BehaviorUtil.destoryPoints(user,x);