mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Core/Player: fix use after free crash
(cherry picked from commit d914c55c05)
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