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);