feat(Core/Scripting): Implement OnAllowedForPlayerLootCheck() hook (#12316)

* feat(Core/Scripting): Implement OnAllowedForPlayerLootCheck() hook

* reverse logic
This commit is contained in:
Skjalf
2022-07-09 00:10:04 -03:00
committed by GitHub
parent 5dec721a71
commit 32ba21d029
9 changed files with 47 additions and 18 deletions

View File

@@ -469,7 +469,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket& recvData)
ItemPosCountVec dest;
InventoryResult msg = target->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, item.itemid, item.count);
if (!item.AllowedForPlayer(target, true))
if (!item.AllowedForPlayer(target, loot->sourceWorldObjectGUID))
msg = EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM;
if (msg != EQUIP_ERR_OK)
{