aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/LootHandler.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-12-30 15:45:37 +0100
committerfunjoker <funjoker109@gmail.com>2024-01-09 12:50:47 +0100
commit0c21c06e6e1857254757bd2669f2fcb26a0b6c59 (patch)
treeecce6bc11d5653be74704a2b871e9af9d400f2ed /src/server/game/Handlers/LootHandler.cpp
parentdbf2f88e40c3e760b4508f0dafaedd065ba95479 (diff)
Core/Quests: Implemented QUEST_OBJECTIVE_FLAG_2_QUEST_BOUND_ITEM that makes required items not be stored in inventory
(cherry picked from commit 4dce6ab228c54319032b346d2d791262eac3d9cd)
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;