forked from mirror/azerothcore-wotlk
fix(Core/Battlefield): block invites and kicks from BF raids (#26015)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13108,6 +13108,11 @@ PartyResult Player::CanUninviteFromGroup(ObjectGuid targetPlayerGUID) const
|
||||
|
||||
if (InBattleground())
|
||||
return ERR_INVITE_RESTRICTED;
|
||||
|
||||
// BF raids are owned by the Battlefield system; leaders/assistants must not
|
||||
// be able to kick members (would drop their team assignment mid-battle).
|
||||
if (grp->isBFGroup())
|
||||
return ERR_NOT_LEADER;
|
||||
}
|
||||
|
||||
return ERR_PARTY_RESULT_OK;
|
||||
|
||||
@@ -126,6 +126,16 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
// Battlefield raids (e.g. Wintergrasp) have their composition managed by the BF
|
||||
// system based on queue and team balance. Letting raid members recruit outsiders
|
||||
// bypasses Battlefield::AddOrSetPlayerToCorrectBfGroup, which on WG entry then
|
||||
// refuses to add the invitee because they are already in a BF group.
|
||||
if (Group* invitingGroup = invitingPlayer->GetGroup(); invitingGroup && invitingGroup->isBFGroup())
|
||||
{
|
||||
SendPartyResult(PARTY_OP_INVITE, membername, ERR_NOT_LEADER);
|
||||
return;
|
||||
}
|
||||
|
||||
Group* group = invitingPlayer->GetGroup();
|
||||
if (group && group->isBGGroup())
|
||||
group = invitingPlayer->GetOriginalGroup();
|
||||
|
||||
Reference in New Issue
Block a user