diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 87e8103e5..3049b4c19 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1510,8 +1510,28 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap) roll->getLoot()->NotifyItemRemoved(roll->itemSlot); roll->getLoot()->unlootedCount--; ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(roll->itemid); - player->AutoStoreLoot(pProto->DisenchantID, LootTemplates_Disenchant, true); player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, 13262); // Disenchant + + ItemPosCountVec dest; + InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, roll->itemid, item->count); + + if(msg == EQUIP_ERR_OK) + { + player->AutoStoreLoot(pProto->DisenchantID, LootTemplates_Disenchant, true); + } + else + { + Loot loot; + loot.FillLoot(pProto->DisenchantID, LootTemplates_Disenchant, player, true); + + uint32 max_slot = loot.GetMaxSlotInLootFor(player); + for(uint32 i = 0; i < max_slot; i++) + { + LootItem* lootItem = loot.LootItemInSlot(i, player); + player->SendEquipError(msg, nullptr, nullptr, lootItem->itemid); + player->SendItemRetrievalMail(lootItem->itemid, lootItem->count); + } + } } } }