mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 01:59:09 +00:00
fix(Core/GameObject): credit nearby group members on object activation if they're in reward range (#8240)
Ported from: cd625a12e2
Credits to @Treeston
This commit is contained in:
@@ -1491,7 +1491,23 @@ void GameObject::Use(Unit* user)
|
||||
if (Battleground* bg = player->GetBattleground())
|
||||
bg->EventPlayerUsedGO(player, this);
|
||||
|
||||
player->KillCreditGO(info->entry, GetGUID());
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
for (GroupReference const* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
if (Player* member = itr->GetSource())
|
||||
{
|
||||
if (member->IsAtGroupRewardDistance(this))
|
||||
{
|
||||
member->KillCreditGO(info->entry, GetGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player->KillCreditGO(info->entry, GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
if (uint32 trapEntry = info->goober.linkedTrapId)
|
||||
|
||||
Reference in New Issue
Block a user