aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Groups/Group.cpp
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2014-08-30 05:03:47 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2014-08-30 05:03:47 +0200
commitf89739dab5d8eec4495da9d7c7199fd0cb9cc851 (patch)
treeb709d335c2715c514d45e54452316a5bf47ebe3a /src/server/game/Groups/Group.cpp
parent06daf22e1ea31d240456fdd05f899b92231458d3 (diff)
parent831a6603d46a6a659ffa1e59d7a87bedcabeae82 (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Diffstat (limited to 'src/server/game/Groups/Group.cpp')
-rw-r--r--src/server/game/Groups/Group.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index 8f90371c481..638cc19784a 100644
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -1453,8 +1453,25 @@ void Group::CountTheRoll(Rolls::iterator rollI)
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 // If the player's inventory is full, send the disenchant result in a mail.
+ {
+ 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, NULL, NULL, lootItem->itemid);
+ player->SendItemRetrievalMail(lootItem->itemid, lootItem->count);
+ }
+ }
}
}
}