From 009ea3890b569f4bdef7d5cb2e87574c176ce2a9 Mon Sep 17 00:00:00 2001 From: EricksOliveira Date: Sat, 13 Jun 2026 09:38:06 +0000 Subject: [PATCH] =?UTF-8?q?fix(Core/Battleground):=20Re-enqueue=20BG=20whe?= =?UTF-8?q?n=20invitation=20expires=20to=20prev=E2=80=A6=20(#25001)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ludwig Co-authored-by: Claude Opus 4.8 (1M context) --- .../game/Battlegrounds/BattlegroundQueue.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index 295b8859f3..169f642eca 100644 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -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);