Extra checks for ItemContainer deleteMe method.

This commit is contained in:
MobiusDevelopment
2022-11-02 02:10:32 +00:00
parent a08a71c145
commit c95be5ef68
33 changed files with 225 additions and 106 deletions

View File

@@ -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();
}