法相修改

back_recharge
duhui 2023-02-21 14:25:10 +08:00
parent 174202bf61
commit 49ac978e36
2 changed files with 5 additions and 3 deletions

View File

@ -27,6 +27,7 @@ import rpc.protocols.PlayerInfoProto;
import util.StringUtil;
import java.util.*;
import java.util.stream.Collectors;
public class EquipLogic {
private static final Logger LOGGER = LoggerFactory.getLogger(EquipLogic.class);
@ -95,7 +96,8 @@ public class EquipLogic {
if (faxiangConfig.getProfession() != 0 && faxiangConfig.getProfession() != scHero.getProfession()){
throw new ErrorCodeException(ErrorCode.HERO_EQUIP_ERR,"英雄职业不符合");
}
if (faxiangConfig.getJob() != 0 && faxiangConfig.getJob() != scHero.getJob()){
List<Integer> jobs = Arrays.stream(faxiangConfig.getJob()).boxed().collect(Collectors.toList());
if (!jobs.contains(0) && !jobs.contains(scHero.getJob())){
throw new ErrorCodeException(ErrorCode.HERO_EQUIP_ERR,"英雄细分职业不符合");
}
}

View File

@ -12,7 +12,7 @@ public class SFaxiangConfig implements BaseConfig {
private int profession;
private int job;
private int[] job;
private int type;
@ -46,7 +46,7 @@ public class SFaxiangConfig implements BaseConfig {
return profession;
}
public int getJob() {
public int[] getJob() {
return job;
}