aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/LootHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Handlers/LootHandler.cpp')
-rwxr-xr-xsrc/server/game/Handlers/LootHandler.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp
index 8e4b41a9be4..8259d0c4e9b 100755
--- a/src/server/game/Handlers/LootHandler.cpp
+++ b/src/server/game/Handlers/LootHandler.cpp
@@ -220,16 +220,18 @@ void WorldSession::HandleLootOpcode(WorldPacket & recv_data)
GetPlayer()->InterruptNonMeleeSpells(false);
}
-void WorldSession::HandleLootReleaseOpcode(WorldPacket & recv_data)
+void WorldSession::HandleLootReleaseOpcode(WorldPacket& recvData)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_RELEASE");
// cheaters can modify lguid to prevent correct apply loot release code and re-loot
// use internal stored guid
- recv_data.read_skip<uint64>(); // guid;
+ uint64 guid;
+ recvData >> guid;
if (uint64 lguid = GetPlayer()->GetLootGUID())
- DoLootRelease(lguid);
+ if (lguid == guid)
+ DoLootRelease(lguid);
}
void WorldSession::DoLootRelease(uint64 lguid)
@@ -470,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);