fix(Core/Battlegrounds): fill existing BGs instead of starting duplicates (#26585)
This commit is contained in:
@@ -948,7 +948,7 @@ BGFreeSlotQueueContainer& BattlegroundMgr::GetBGFreeSlotQueueStore(BattlegroundT
|
|||||||
|
|
||||||
void BattlegroundMgr::AddToBGFreeSlotQueue(BattlegroundTypeId bgTypeId, Battleground* bg)
|
void BattlegroundMgr::AddToBGFreeSlotQueue(BattlegroundTypeId bgTypeId, Battleground* bg)
|
||||||
{
|
{
|
||||||
bgDataStore[bgTypeId].BGFreeSlotQueue.push_front(bg);
|
bgDataStore[bgTypeId].BGFreeSlotQueue.push_back(bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattlegroundMgr::RemoveFromBGFreeSlotQueue(BattlegroundTypeId bgTypeId, uint32 instanceId)
|
void BattlegroundMgr::RemoveFromBGFreeSlotQueue(BattlegroundTypeId bgTypeId, uint32 instanceId)
|
||||||
|
|||||||
@@ -805,8 +805,7 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 diff, BattlegroundTypeId
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// battleground with free slot for player should be always in the beggining of the queue
|
// fill existing joinable battlegrounds, oldest first, before a new instance may form below
|
||||||
// maybe it would be better to create bgfreeslotqueue for each bracket_id
|
|
||||||
BGFreeSlotQueueContainer& bgQueues = sBattlegroundMgr->GetBGFreeSlotQueueStore(bgTypeId);
|
BGFreeSlotQueueContainer& bgQueues = sBattlegroundMgr->GetBGFreeSlotQueueStore(bgTypeId);
|
||||||
for (BGFreeSlotQueueContainer::iterator itr = bgQueues.begin(); itr != bgQueues.end();)
|
for (BGFreeSlotQueueContainer::iterator itr = bgQueues.begin(); itr != bgQueues.end();)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -554,6 +554,8 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket& recvData)
|
|||||||
// leaks forever, permanently skewing team selection and blocking the
|
// leaks forever, permanently skewing team selection and blocking the
|
||||||
// empty instance's cleanup.
|
// empty instance's cleanup.
|
||||||
bg->DecreaseInvitedCount(teamId);
|
bg->DecreaseInvitedCount(teamId);
|
||||||
|
if (bg->HasFreeSlots())
|
||||||
|
bg->AddToBGFreeSlotQueue();
|
||||||
_player->RemoveBattlegroundQueueId(bgQueueTypeId);
|
_player->RemoveBattlegroundQueueId(bgQueueTypeId);
|
||||||
_player->SetBattlegroundId(0, BATTLEGROUND_TYPE_NONE, PLAYER_MAX_BATTLEGROUND_QUEUES, false, false, TEAM_NEUTRAL);
|
_player->SetBattlegroundId(0, BATTLEGROUND_TYPE_NONE, PLAYER_MAX_BATTLEGROUND_QUEUES, false, false, TEAM_NEUTRAL);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user