Extra checks for ItemContainer deleteMe method.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user