Core/Items: Fixed crash happening when deleting item before it was saved for the first time

Closes #26532
This commit is contained in:
Shauren
2021-05-18 14:41:06 +02:00
parent ffa262bfa2
commit 3df64ceff4

View File

@@ -12690,7 +12690,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
pItem->SetSlot(NULL_SLOT);
pItem->SetState(ITEM_REMOVED, this);
if (pItem->GetTemplate()->GetInventoryType() != INVTYPE_NON_EQUIP)
if (pProto->GetInventoryType() != INVTYPE_NON_EQUIP)
UpdateAverageItemLevelTotal();
if (bag == INVENTORY_SLOT_BAG_0)
UpdateAverageItemLevelEquipped();