fix(Core/Loot): Fixed some chests inside dungeons not being bound only to participants. (#10995)

This commit is contained in:
UltraNix
2022-03-18 22:33:04 +01:00
committed by GitHub
parent c11a96b775
commit 68891ccd74
11 changed files with 78 additions and 8 deletions

View File

@@ -2546,17 +2546,32 @@ void GameObject::SetLootRecipient(Map* map)
bool GameObject::IsLootAllowedFor(Player const* player) const
{
if (!m_lootRecipient && !m_lootRecipientGroup)
{
return true;
}
if (player->GetGUID() == m_lootRecipient)
{
return true;
}
if (player->HasPendingBind())
{
return false;
}
// if we dont have a group we arent the recipient
// if go doesnt have group bound it means it was solo killed by someone else
Group const* playerGroup = player->GetGroup();
if (!playerGroup || playerGroup != GetLootRecipientGroup()) // if we dont have a group we arent the recipient
return false; // if go doesnt have group bound it means it was solo killed by someone else
if (!playerGroup || playerGroup != GetLootRecipientGroup())
{
return false;
}
if (!HasAllowedLooter(player->GetGUID()))
{
return false;
}
return true;
}