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 66a16f661..92c46cb5a 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 @@ -204,10 +204,11 @@ public class HeroLogic{ //宝器 if(type==4){ Map equipMap = user.getEquipManager().getEquipMap(); + Set needRemove = new HashSet<>(equipMap.size()); for(Map.Entry equipInfoEntry : equipMap.entrySet()){ PropertyItem value = equipInfoEntry.getValue(); if (value == null) { - equipManager.remove(equipInfoEntry.getKey()); + needRemove.add(equipInfoEntry.getKey()); LOGGER.info("getAllEquipInfo uid={} remove null jewel{}", uid, equipInfoEntry.getKey()); continue; } @@ -215,6 +216,11 @@ public class HeroLogic{ equipList.add(CBean2Proto.getEquipProto(value)); } } + if (!needRemove.isEmpty()) { + for (String id : needRemove) { + equipManager.remove(id); + } + } }else { throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); }