Browse Source

temporary enchant stripping

lakebane
FatBoy-DOTC 3 days ago
parent
commit
bb1a99912c
  1. 4
      src/engine/objects/CharacterItemManager.java
  2. 6
      src/engine/objects/Item.java

4
src/engine/objects/CharacterItemManager.java

@ -1056,7 +1056,7 @@ public class CharacterItemManager {
// add to Bank // add to Bank
this.bank.add(i); this.bank.add(i);
i.addToCache(); i.addToCache();
//i.stripCastableEnchants(); i.stripCastableEnchants();
calculateWeights(); calculateWeights();
@ -1205,7 +1205,7 @@ public class CharacterItemManager {
calculateWeights(); calculateWeights();
//i.stripCastableEnchants(); i.stripCastableEnchants();
return true; return true;
} }

6
src/engine/objects/Item.java

@ -818,11 +818,15 @@ public class Item extends AbstractWorldObject {
} }
public void stripCastableEnchants(){ public void stripCastableEnchants(){
ArrayList<Effect> ToRemove = new ArrayList<>();
for(Effect eff : this.effects.values()){ for(Effect eff : this.effects.values()){
if(eff.getJobContainer() != null && !eff.getJobContainer().noTimer()){ 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 //Only to be used for trading
public void setOwnerID(int ownerID) { public void setOwnerID(int ownerID) {

Loading…
Cancel
Save