fix(Core/Battleground): Re-enqueue BG when invitation expires to prev… (#25001)

Co-authored-by: Ludwig <sudlud@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
EricksOliveira
2026-06-13 09:38:06 +00:00
committed by GitHub
parent a9db3544e2
commit 009ea3890b
@@ -310,9 +310,24 @@ void BattlegroundQueue::RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount)
// if invited to bg, and should decrease invited count, then do it
if (decreaseInvitedCount && groupInfo->IsInvitedToBGInstanceGUID)
{
if (Battleground* bg = sBattlegroundMgr->GetBattleground(groupInfo->IsInvitedToBGInstanceGUID, groupInfo->BgTypeId))
{
bg->DecreaseInvitedCount(groupInfo->teamId);
// re-enqueue BG if free slots reopened due to invite expiration
if (bg->HasFreeSlots())
{
bg->AddToBGFreeSlotQueue();
BattlegroundQueueTypeId queueTypeId =
BattlegroundMgr::BGQueueTypeId(bg->GetBgTypeID(), bg->GetArenaType());
sBattlegroundMgr->ScheduleQueueUpdate(0, 0, queueTypeId, bg->GetBgTypeID(), bg->GetBracketId());
}
}
}
// remove player queue info
m_QueuedPlayers.erase(itr);