mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-04 22:07:52 +00:00
fix(Core/Player): remove deleted equip-probe items from the item update queue (#26606)
This commit is contained in:
@@ -1863,6 +1863,10 @@ InventoryResult Player::CanEquipNewItem(uint8 slot, uint16& dest, uint32 item, b
|
||||
if (pItem)
|
||||
{
|
||||
InventoryResult result = CanEquipItem(slot, dest, pItem, swap);
|
||||
// Random-property items queue themselves on creation (SetItemRandomProperties
|
||||
// -> SetState(ITEM_CHANGED, owner)); the probe must leave the update queue
|
||||
// before deletion or the queue keeps a pointer to freed memory.
|
||||
pItem->RemoveFromUpdateQueueOf(const_cast<Player*>(this));
|
||||
delete pItem;
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user