mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 08:17:56 +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 invited to bg, and should decrease invited count, then do it
|
||||||
if (decreaseInvitedCount && groupInfo->IsInvitedToBGInstanceGUID)
|
if (decreaseInvitedCount && groupInfo->IsInvitedToBGInstanceGUID)
|
||||||
|
{
|
||||||
if (Battleground* bg = sBattlegroundMgr->GetBattleground(groupInfo->IsInvitedToBGInstanceGUID, groupInfo->BgTypeId))
|
if (Battleground* bg = sBattlegroundMgr->GetBattleground(groupInfo->IsInvitedToBGInstanceGUID, groupInfo->BgTypeId))
|
||||||
|
{
|
||||||
bg->DecreaseInvitedCount(groupInfo->teamId);
|
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
|
// remove player queue info
|
||||||
m_QueuedPlayers.erase(itr);
|
m_QueuedPlayers.erase(itr);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user