fix(Core/BG): invited count leak when a BG teleport fails + group join checks (#26422)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -252,7 +252,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
}
|
||||
});
|
||||
|
||||
if (err)
|
||||
if (err > 0)
|
||||
{
|
||||
err = grp->CanJoinBattlegroundQueue(bg, bgQueueTypeId, 0, bg->GetMaxPlayersPerTeam(), false, 0);
|
||||
}
|
||||
|
||||
@@ -152,7 +152,17 @@ void WorldSession::HandleMoveWorldportAck()
|
||||
{
|
||||
// but landed on another map, cleanup data
|
||||
if (!mEntry->IsBattlegroundOrArena())
|
||||
{
|
||||
// release the unconsumed invite, otherwise the BG never satisfies its empty + uninvited deletion gate
|
||||
if (Battleground* bg = _player->GetBattleground(true))
|
||||
if (_player->IsInvitedForBattlegroundInstance(bg->GetInstanceID()))
|
||||
{
|
||||
bg->DecreaseInvitedCount(_player->GetBgTeamId());
|
||||
_player->RemoveBattlegroundQueueId(BattlegroundMgr::BGQueueTypeId(bg->GetBgTypeID(), bg->GetArenaType()));
|
||||
}
|
||||
|
||||
_player->SetBattlegroundId(0, BATTLEGROUND_TYPE_NONE, PLAYER_MAX_BATTLEGROUND_QUEUES, false, false, TEAM_NEUTRAL);
|
||||
}
|
||||
// everything ok
|
||||
else if (Battleground* bg = _player->GetBattleground())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user