fix(Core/Loot): Disenchanted, milled or prospected items should be se… (#14273)

fix(Core/Loot): Disenchanted, milled or prospected items should be sent as retrieval mail in case of full bags.

Fixes #10798
This commit is contained in:
UltraNix
2022-12-28 01:43:12 +01:00
committed by GitHub
parent 2eb374c6e4
commit 6345958769
4 changed files with 28 additions and 11 deletions

View File

@@ -93,7 +93,16 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recvData)
loot = &creature->loot;
}
player->StoreLootItem(lootSlot, loot);
InventoryResult msg;
LootItem* lootItem = player->StoreLootItem(lootSlot, loot, msg);
if (msg != EQUIP_ERR_OK && lguid.IsItem() && loot->loot_type != LOOT_CORPSE)
{
lootItem->is_looted = true;
loot->NotifyItemRemoved(lootItem->itemIndex);
loot->unlootedCount--;
player->SendItemRetrievalMail(lootItem->itemid, lootItem->count);
}
// If player is removing the last LootItem, delete the empty container.
if (loot->isLooted() && lguid.IsItem())