diff --git a/game-server/src/com/aionemu/gameserver/model/team/legion/Legion.java b/game-server/src/com/aionemu/gameserver/model/team/legion/Legion.java index 824625275..ce25c058d 100644 --- a/game-server/src/com/aionemu/gameserver/model/team/legion/Legion.java +++ b/game-server/src/com/aionemu/gameserver/model/team/legion/Legion.java @@ -2,10 +2,7 @@ import java.sql.Timestamp; import java.time.Duration; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; import com.aionemu.gameserver.configs.main.LegionConfig; @@ -35,7 +32,7 @@ public class Legion extends AionObject { private Announcement announcement; private LegionEmblem legionEmblem = new LegionEmblem(); private LegionWarehouse legionWarehouse; - private Map> legionHistoryByType; + private final Map> legionHistoryByType = new EnumMap<>(Type.class); private AtomicBoolean hasBonus = new AtomicBoolean(false); private int occupiedLegionDominion = 0; private int currentLegionDominion = 0; @@ -45,6 +42,7 @@ public Legion(int legionId, String legionName) { super(legionId); this.legionName = legionName; this.legionWarehouse = new LegionWarehouse(this); + setHistory(Collections.emptyMap()); } public int getLegionId() { @@ -446,7 +444,10 @@ public List addHistory(LegionHistoryEntry entry) { } public void setHistory(Map> history) { - legionHistoryByType = history; + for (Type type : Type.values()) { + List entries = history.get(type); + legionHistoryByType.put(type, entries == null ? new ArrayList<>(1) : entries); + } } public void addBonus() {