diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index 78094707..a045c9f6 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -336,6 +336,26 @@ public enum BuildingManager { building.getHirelings().remove(hireling); + // Remove from zone mob set + + if (hireling.getObjectType().equals(GameObjectType.Mob)) { + + Mob hirelingMob = (Mob) hireling; + + if (hirelingMob.getParentZone() != null) + hirelingMob.getParentZone().zoneMobSet.remove(hireling); + + } + + if (hireling.getObjectType().equals(GameObjectType.NPC)) { + + NPC hirelingNPC = (NPC) hireling; + + if (hirelingNPC.getParentZone() != null) + hirelingNPC.getParentZone().zoneNPCSet.remove(hireling); + + } + // Unload hireling from world DbManager.removeFromCache(hireling);