Browse Source

Hirelings removed from zone mob set

combat-2
MagicBot 1 year ago
parent
commit
ea23003807
  1. 20
      src/engine/gameManager/BuildingManager.java

20
src/engine/gameManager/BuildingManager.java

@ -336,6 +336,26 @@ public enum BuildingManager { @@ -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);

Loading…
Cancel
Save