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)
|
if (pItem)
|
||||||
{
|
{
|
||||||
InventoryResult result = CanEquipItem(slot, dest, pItem, swap);
|
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;
|
delete pItem;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user