From 5c0a4802b94804416bdbb611336d5033e105a5ab Mon Sep 17 00:00:00 2001 From: lvxinran Date: Mon, 2 Aug 2021 10:55:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B2=A1=E5=B0=8F=E6=80=AA=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E4=BD=BF=E7=94=A8=E7=82=B8=E5=BC=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ljsd/jieling/handler/map/mapType/TowerMap.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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);