aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/LootHandler.cpp
diff options
context:
space:
mode:
authorKandera <KanderaDev@gmail.com>2012-07-05 12:59:42 -0400
committerKandera <KanderaDev@gmail.com>2012-07-05 12:59:42 -0400
commit869ea349879f85f2246921569c3a02807e266479 (patch)
treeb913c5ec1ebdc29bd428695b44bcbc1be74bea54 /src/server/game/Handlers/LootHandler.cpp
parent5a9fa4439d0da81e18c22d233c33bc335bdee0bb (diff)
Core/Loot: fix the way quest items are handled. so far ive only found 3 quest items that should be able to be masterlooted. added a new flag to item_template.flagsCustom to allow for making a quest item always follow loot rules. a bonus may be the fix of the handlelootmasteropcode crash!
Diffstat (limited to 'src/server/game/Handlers/LootHandler.cpp')
-rwxr-xr-xsrc/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 339c7a44d9f..72e0b63f5b6 100755
--- a/src/server/game/Handlers/LootHandler.cpp
+++ b/src/server/game/Handlers/LootHandler.cpp
@@ -472,16 +472,18 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data)
if (!loot)
return;
- if (slotid > loot->items.size())
+ if (slotid > loot->items.size() + loot->quest_items.size())
{
sLog->outDebug(LOG_FILTER_LOOT, "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)", GetPlayer()->GetName(), slotid, (unsigned long)loot->items.size());
return;
}
- LootItem& item = loot->items[slotid];
+ LootItem& item = slotid > loot->items.size() ? loot->quest_items[slotid - loot->items.size()] : loot->items[slotid];
ItemPosCountVec dest;
InventoryResult msg = target->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, item.itemid, item.count);
+ if (item.follow_loot_rules && !item.AllowedForPlayer(target))
+ msg = EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM;
if (msg != EQUIP_ERR_OK)
{
target->SendEquipError(msg, NULL, NULL, item.itemid);