mirror of
https://gitcode.com/GitHub_Trending/az/azerothcore-wotlk.git
synced 2026-07-11 03:13:10 +00:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user