aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/LootHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Handlers/LootHandler.cpp')
-rw-r--r--src/server/game/Handlers/LootHandler.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp
index 40f332745d5..3362e68c33c 100644
--- a/src/server/game/Handlers/LootHandler.cpp
+++ b/src/server/game/Handlers/LootHandler.cpp
@@ -463,8 +463,10 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPackets::Loot::MasterLootItem
}
// now move item from loot to target inventory
- Item* newitem = target->StoreNewItem(dest, item.itemid, true, item.randomProperties, item.GetAllowedLooters(), item.context);
- aeResult.Add(newitem, item.count, loot->loot_type, loot->GetDungeonEncounterId());
+ if (Item* newitem = target->StoreNewItem(dest, item.itemid, true, item.randomProperties, item.GetAllowedLooters(), item.context))
+ aeResult.Add(newitem, item.count, loot->loot_type, loot->GetDungeonEncounterId());
+ else
+ target->ApplyItemLootedSpell(sObjectMgr->GetItemTemplate(item.itemid));
// mark as looted
item.count = 0;