Core/Player: fix use after free crash
(cherry picked from commit d914c55c0585fe31a9a1b9fe4e9d4a9b498e8e8f)
This commit is contained in:
@@ -13875,10 +13875,11 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del)
|
||||
pItem->RemoveFromWorld();
|
||||
if (del)
|
||||
{
|
||||
pItem->SetState(ITEM_REMOVED, this);
|
||||
if (ItemTemplate const* itemTemplate = pItem->GetTemplate())
|
||||
if (itemTemplate->GetFlags() & ITEM_FLAG_HAS_LOOT)
|
||||
sLootItemStorage->RemoveStoredLootForContainer(pItem->GetGUID().GetCounter());
|
||||
|
||||
pItem->SetState(ITEM_REMOVED, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user