From ac3588c76a6ecca4a9e2c55ad2c4cee0965296db Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 25 Aug 2023 12:54:03 -0400 Subject: [PATCH] manager init moved to the top of method. --- src/engine/objects/Mob.java | 3 ++- src/engine/objects/NPC.java | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 008ee7d8..b35cb247 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -1751,6 +1751,8 @@ public class Mob extends AbstractIntelligenceAgent { @Override public void runAfterLoad() { + this.charItemManager = new CharacterItemManager(this); + if (ConfigManager.serverType.equals(ServerType.LOGINSERVER)) return; @@ -1866,7 +1868,6 @@ public class Mob extends AbstractIntelligenceAgent { // Initialize inventory - this.charItemManager = new CharacterItemManager(this); this.charItemManager.load(); this.loadInventory(); diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index 338d84c6..1ebc4c39 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -806,6 +806,8 @@ public class NPC extends AbstractCharacter { @Override public void runAfterLoad() { + this.charItemManager = new CharacterItemManager(this); + if (ConfigManager.serverType.equals(ServerType.LOGINSERVER)) return; @@ -847,10 +849,6 @@ public class NPC extends AbstractCharacter { if (wordCount(this.name) < 2 && this.contract != null) this.name += " the " + this.contract.getName(); - // Initialize inventory - - this.charItemManager = new CharacterItemManager(this); - // Configure parent zone adding this NPC to the // zone collection