fix(Core/Player): Prevent exploit to loot items that are already looted

* 586c00fe2e

Co-Authored-By: Gildor <521036+Jildor@users.noreply.github.com>
This commit is contained in:
Kitzunu
2021-02-02 20:02:39 +01:00
parent 0d52b4ca4a
commit 8376bba579

View File

@@ -25362,16 +25362,16 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot)
LootItem* item = loot->LootItemInSlot(lootSlot, this, &qitem, &ffaitem, &conditem);
if (!item)
if (!item || item->is_looted)
{
SendEquipError(EQUIP_ERR_ALREADY_LOOTED, NULL, nullptr);
SendEquipError(EQUIP_ERR_ALREADY_LOOTED, nullptr, nullptr);
return;
}
// Xinef: exploit protection, dont allow to loot normal items if player is not master loot
// Xinef: only quest, ffa and conditioned items
if (!IS_ITEM_GUID(GetLootGUID()) && GetGroup() && GetGroup()->GetLootMethod() == MASTER_LOOT && GetGUID() != GetGroup()->GetMasterLooterGuid())
if (qitem == NULL && ffaitem == NULL && conditem == nullptr)
if (qitem == nullptr && ffaitem == nullptr && conditem == nullptr)
{
SendLootRelease(GetLootGUID());
return;