From 719c855bdbad83694333db6238dc10666d13b33c Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 25 Aug 2023 12:27:58 -0400 Subject: [PATCH] Cleanup of inventoryManager usage. --- src/engine/objects/AbstractCharacter.java | 7 ------- src/engine/objects/Mob.java | 3 +-- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/engine/objects/AbstractCharacter.java b/src/engine/objects/AbstractCharacter.java index 960540b8..8f4ffcf8 100644 --- a/src/engine/objects/AbstractCharacter.java +++ b/src/engine/objects/AbstractCharacter.java @@ -231,8 +231,6 @@ public abstract class AbstractCharacter extends AbstractWorldObject { this.skills = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); this.initializeCharacter(); - // Dangerous to use THIS in a constructor!!! - this.charItemManager = new CharacterItemManager(this); } /** @@ -275,8 +273,6 @@ public abstract class AbstractCharacter extends AbstractWorldObject { this.powers = new ConcurrentHashMap<>(); this.initializeCharacter(); - // Dangerous to use THIS in a constructor!!! - this.charItemManager = new CharacterItemManager(this); } /** @@ -357,9 +353,6 @@ public abstract class AbstractCharacter extends AbstractWorldObject { this.powers = new ConcurrentHashMap<>(); this.initializeCharacter(); - - // Dangerous to use THIS in a constructor!!! - this.charItemManager = new CharacterItemManager(this); } public static int getBankCapacity() { diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index b3548705..3d3c2134 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -1827,8 +1827,6 @@ public class Mob extends AbstractIntelligenceAgent { this.defenseRating = (short) this.mobBase.getDefenseRating(); this.isActive = true; - this.charItemManager.load(); - // Load AI for wall archers if (this.contract != null && NPC.ISWallArcher(this.contract)) { @@ -1869,6 +1867,7 @@ public class Mob extends AbstractIntelligenceAgent { // Initialize inventory this.charItemManager = new CharacterItemManager(this); + this.charItemManager.load(); this.loadInventory(); try {