From bb1a99912c05a0c0ff77ee8b465cab68abad12fe Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 27 Jan 2025 12:46:10 -0600 Subject: [PATCH] temporary enchant stripping --- src/engine/objects/CharacterItemManager.java | 4 ++-- src/engine/objects/Item.java | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/engine/objects/CharacterItemManager.java b/src/engine/objects/CharacterItemManager.java index 3aaa74f3..8c00b32e 100644 --- a/src/engine/objects/CharacterItemManager.java +++ b/src/engine/objects/CharacterItemManager.java @@ -1056,7 +1056,7 @@ public class CharacterItemManager { // add to Bank this.bank.add(i); i.addToCache(); - //i.stripCastableEnchants(); + i.stripCastableEnchants(); calculateWeights(); @@ -1205,7 +1205,7 @@ public class CharacterItemManager { calculateWeights(); - //i.stripCastableEnchants(); + i.stripCastableEnchants(); return true; } diff --git a/src/engine/objects/Item.java b/src/engine/objects/Item.java index 19f339ae..45601326 100644 --- a/src/engine/objects/Item.java +++ b/src/engine/objects/Item.java @@ -818,11 +818,15 @@ public class Item extends AbstractWorldObject { } public void stripCastableEnchants(){ + ArrayList ToRemove = new ArrayList<>(); for(Effect eff : this.effects.values()){ if(eff.getJobContainer() != null && !eff.getJobContainer().noTimer()){ - eff.endEffect(); + eff.endEffectNoPower(); + eff.getJobContainer().cancelJob(); + ToRemove.add(eff); } } + this.effects.values().removeAll(ToRemove); } //Only to be used for trading public void setOwnerID(int ownerID) {