mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-20 06:59:46 -04:00
Scripts/ICC: Fix chest loot exploit
Fix an exploit at chest loot bosses Valithria and Deathbringer that allowed the first played to hit them to leave party at low hp % and loot the whole chest alone, without the party being able to loot anything.
This commit is contained in:
@@ -2187,7 +2187,7 @@ Group* GameObject::GetLootRecipientGroup() const
|
||||
return sGroupMgr->GetGroupByGUID(m_lootRecipientGroup);
|
||||
}
|
||||
|
||||
void GameObject::SetLootRecipient(Unit* unit)
|
||||
void GameObject::SetLootRecipient(Unit* unit, Group* group)
|
||||
{
|
||||
// set the player whose group should receive the right
|
||||
// to loot the creature after it dies
|
||||
@@ -2196,7 +2196,7 @@ void GameObject::SetLootRecipient(Unit* unit)
|
||||
if (!unit)
|
||||
{
|
||||
m_lootRecipient.Clear();
|
||||
m_lootRecipientGroup = 0;
|
||||
m_lootRecipientGroup = group ? group->GetLowGUID() : 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2208,8 +2208,12 @@ void GameObject::SetLootRecipient(Unit* unit)
|
||||
return;
|
||||
|
||||
m_lootRecipient = player->GetGUID();
|
||||
if (Group* group = player->GetGroup())
|
||||
|
||||
// either get the group from the passed parameter or from unit's one
|
||||
if (group)
|
||||
m_lootRecipientGroup = group->GetLowGUID();
|
||||
else if (Group* unitGroup = player->GetGroup())
|
||||
m_lootRecipientGroup = unitGroup->GetLowGUID();
|
||||
}
|
||||
|
||||
bool GameObject::IsLootAllowedFor(Player const* player) const
|
||||
|
||||
Reference in New Issue
Block a user