Skip to content

Commit dabb8f7

Browse files
Nyeriahclaude
andauthored
fix(Core/Battlefield): block invites and kicks from BF raids (azerothcore#26015)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 43e16de commit dabb8f7

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/server/game/Entities/Player/Player.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13108,6 +13108,11 @@ PartyResult Player::CanUninviteFromGroup(ObjectGuid targetPlayerGUID) const
1310813108

1310913109
if (InBattleground())
1311013110
return ERR_INVITE_RESTRICTED;
13111+
13112+
// BF raids are owned by the Battlefield system; leaders/assistants must not
13113+
// be able to kick members (would drop their team assignment mid-battle).
13114+
if (grp->isBFGroup())
13115+
return ERR_NOT_LEADER;
1311113116
}
1311213117

1311313118
return ERR_PARTY_RESULT_OK;

src/server/game/Handlers/GroupHandler.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,16 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData)
126126
return;
127127
}
128128

129+
// Battlefield raids (e.g. Wintergrasp) have their composition managed by the BF
130+
// system based on queue and team balance. Letting raid members recruit outsiders
131+
// bypasses Battlefield::AddOrSetPlayerToCorrectBfGroup, which on WG entry then
132+
// refuses to add the invitee because they are already in a BF group.
133+
if (Group* invitingGroup = invitingPlayer->GetGroup(); invitingGroup && invitingGroup->isBFGroup())
134+
{
135+
SendPartyResult(PARTY_OP_INVITE, membername, ERR_NOT_LEADER);
136+
return;
137+
}
138+
129139
Group* group = invitingPlayer->GetGroup();
130140
if (group && group->isBGGroup())
131141
group = invitingPlayer->GetOriginalGroup();

0 commit comments

Comments
 (0)