diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/World.java index 3ff4827232..50a96f8d0c 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/World.java @@ -111,18 +111,6 @@ public class World _allObjects.remove(object.getObjectId()); } - /** - * Removes the objects. - * @param list the list - */ - public void removeObjects(List list) - { - for (int i = 0; i < list.size(); i++) - { - _allObjects.remove(list.get(i).getObjectId()); - } - } - /** * Return the WorldObject object that belongs to an ID or null if no object found.
*
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index d772c62b53..d856fea288 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -20,9 +20,7 @@ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Logger; @@ -557,19 +555,20 @@ public abstract class ItemContainer */ public void deleteMe() { - try + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { - updateDatabase(); - } - catch (Throwable t) - { - LOGGER.warning("deletedMe() " + t); + for (Item item : _items) + { + item.updateDatabase(); + } + } + + for (Item item : _items) + { + World.getInstance().removeObject(item); } - final List items = new ArrayList<>(_items); _items.clear(); - - World.getInstance().removeObjects(items); } /** @@ -577,7 +576,7 @@ public abstract class ItemContainer */ public void updateDatabase() { - if ((getOwner() != null) && (_items != null)) + if (getOwner() != null) { for (Item item : _items) { diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/World.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/World.java index 3ff4827232..50a96f8d0c 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/World.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/World.java @@ -111,18 +111,6 @@ public class World _allObjects.remove(object.getObjectId()); } - /** - * Removes the objects. - * @param list the list - */ - public void removeObjects(List list) - { - for (int i = 0; i < list.size(); i++) - { - _allObjects.remove(list.get(i).getObjectId()); - } - } - /** * Return the WorldObject object that belongs to an ID or null if no object found.
*
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 56720d473c..03af3b9da4 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -20,9 +20,7 @@ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Logger; @@ -560,19 +558,20 @@ public abstract class ItemContainer */ public void deleteMe() { - try + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { - updateDatabase(); - } - catch (Throwable t) - { - LOGGER.warning("deletedMe() " + t); + for (Item item : _items) + { + item.updateDatabase(); + } + } + + for (Item item : _items) + { + World.getInstance().removeObject(item); } - final List items = new ArrayList<>(_items); _items.clear(); - - World.getInstance().removeObjects(items); } /** @@ -580,7 +579,7 @@ public abstract class ItemContainer */ public void updateDatabase() { - if ((getOwner() != null) && (_items != null)) + if (getOwner() != null) { for (Item item : _items) { diff --git a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 177c250f10..745acde6b3 100644 --- a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -534,15 +534,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index f40d9aadda..b0817894fd 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -534,15 +534,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index f40d9aadda..b0817894fd 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -534,15 +534,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); } diff --git a/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java b/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java index 679e912b59..230f0169d0 100644 --- a/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java +++ b/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/gameserver/model/itemcontainer/ItemContainer.java @@ -601,15 +601,20 @@ public abstract class ItemContainer */ public void deleteMe() { - if (getOwner() != null) + if ((this instanceof PlayerInventory) || (this instanceof PlayerWarehouse) || (getOwner() != null)) { for (Item item : _items) { item.updateDatabase(true); item.stopAllTasks(); - World.getInstance().removeObject(item); } } + + for (Item item : _items) + { + World.getInstance().removeObject(item); + } + _items.clear(); }