From 3540d350b9a7bc70fe161bb56924133d17335630 Mon Sep 17 00:00:00 2001 From: zhangshanxue Date: Wed, 29 Apr 2020 14:19:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ljsd/jieling/logic/hero/HeroLogic.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java index da7440d90..500fffa3a 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java @@ -744,22 +744,19 @@ public class HeroLogic{ for(String consumeHero : heroIdsList){ Hero hero = heroManager.getHero(consumeHero); if( null == hero ){ - canUse =false; - break; + throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH); } if( 1 == isSame) { if(hero.getTemplateId() != targetHero.getTemplateId()){ - canUse =false; - break; + throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH); } } if( starLimit != 0 ) { if(hero.getStar() != starLimit){ - canUse =false; - break; + throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH); } } @@ -767,15 +764,13 @@ public class HeroLogic{ SCHero scHeroTmp = SCHero.getsCHero().get(hero.getTemplateId()); SCHero targetSHero = SCHero.getsCHero().get(targetHero.getTemplateId()); if( scHeroTmp.getPropertyName() != targetSHero.getPropertyName() ){ - canUse =false; - break; + throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH); } } if( isId != 0) { if(hero.getTemplateId() != isId){ - canUse =false; - break; + throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH); } } removeHeroIds.add(consumeHero);