diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/home/ArchitectureUnLockHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/home/ArchitectureUnLockHandler.java index 2ce7a1279..dd1c46cfa 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/home/ArchitectureUnLockHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/home/ArchitectureUnLockHandler.java @@ -85,7 +85,7 @@ public class ArchitectureUnLockHandler implements IEventHandler { break; default: // 其他条件暂不处理,有需求再加 - break; + continue; } // 浮生殿解锁触发任务 diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/home/HomeLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/home/HomeLogic.java index d41d3fa92..2e916a32b 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/home/HomeLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/home/HomeLogic.java @@ -73,6 +73,20 @@ public class HomeLogic { LOGGER.error("浮生门,表信息,建筑id不存在:{}", info.getId()); continue; } + //升级前置条件 + int[] rule = landLevel.getRule(); + if (rule != null){ + ArchitectureInfo info1 = user.getPlayerInfoManager().getArchitectureInfoMap().get(rule[0]); + if (info1 == null){ + LOGGER.error("浮生门,前置建筑未解锁,升级的建筑:{},前置建筑:{}",id,rule[0]); + continue; + } + int level = Optional.ofNullable(config.get(info1.getId())).map(SHomeLandLevel::getlevel).orElse(0); + if (level < rule[1]){ + LOGGER.error("浮生门,前置建筑等级不足,升级的建筑:{},前置建筑等级:{}",id,level); + continue; + } + } // 最高等级 int maxId = config.values().stream().filter(v->v.getPoolID()==landLevel.getPoolID()).mapToInt(SHomeLandLevel::getlevel).max().orElse(0); if (info.getId() == maxId) {