Minions now use copyonwrite collection. Slot agnostic.

This commit is contained in:
2023-09-04 14:50:59 -04:00
parent 57ff1ede97
commit 9a6510c320
9 changed files with 108 additions and 86 deletions
+12 -8
View File
@@ -640,28 +640,31 @@ public class NPC extends AbstractCharacter {
public void removeMinions() {
for (Mob toRemove : this.siegeMinionMap.keySet()) {
for (Integer minionUUID : this.minions) {
Mob minionMob = Mob.getMob(minionUUID);
try {
toRemove.clearEffects();
minionMob.clearEffects();
} catch (Exception e) {
Logger.error(e.getMessage());
}
if (toRemove.getParentZone() != null)
toRemove.getParentZone().zoneMobSet.remove(toRemove);
if (minionMob.getParentZone() != null)
minionMob.getParentZone().zoneMobSet.remove(minionMob);
WorldGrid.RemoveWorldObject(toRemove);
DbManager.removeFromCache(toRemove);
WorldGrid.RemoveWorldObject(minionMob);
DbManager.removeFromCache(minionMob);
PlayerCharacter petOwner = (PlayerCharacter) toRemove.guardCaptain;
PlayerCharacter petOwner = (PlayerCharacter) minionMob.guardCaptain;
if (petOwner != null) {
petOwner.setPet(null);
toRemove.guardCaptain = null;
minionMob.guardCaptain = null;
PetMsg petMsg = new PetMsg(5, null);
Dispatch dispatch = Dispatch.borrow(petOwner, petMsg);
@@ -669,6 +672,7 @@ public class NPC extends AbstractCharacter {
}
}
}
@Override