Browse Source

temporary enchant stripping

lakebane
FatBoy-DOTC 2 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 { @@ -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 { @@ -1205,7 +1205,7 @@ public class CharacterItemManager {
calculateWeights();
//i.stripCastableEnchants();
i.stripCastableEnchants();
return true;
}

6
src/engine/objects/Item.java

@ -818,11 +818,15 @@ public class Item extends AbstractWorldObject { @@ -818,11 +818,15 @@ public class Item extends AbstractWorldObject {
}
public void stripCastableEnchants(){
ArrayList<Effect> 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) {

Loading…
Cancel
Save