fix(Core/Battleground): fix queue issue (#3116)

* Remove useless code that was only causing issue to the BG queue

* Prevent new Battlegrounds to start if there are already other Battlegrounds that have free slots

Co-authored-by Yehonal <yehonal.azeroth@gmail.com>
This commit is contained in:
Francesco Borzì
2020-06-14 23:12:24 +02:00
committed by GitHub
parent cccdb0a692
commit ebec48e6fd
3 changed files with 8 additions and 12 deletions

View File

@@ -670,7 +670,7 @@ void BattlegroundQueue::UpdateEvents(uint32 diff)
struct BgEmptinessComp { bool operator()(Battleground* const& bg1, Battleground* const& bg2) const { return ((float)bg1->GetMaxFreeSlots() / (float)bg1->GetMaxPlayersPerTeam()) > ((float)bg2->GetMaxFreeSlots() / (float)bg2->GetMaxPlayersPerTeam()); } };
typedef std::set<Battleground*, BgEmptinessComp> BattlegroundNeedSet;
void BattlegroundQueue::BattlegroundQueueUpdate(BattlegroundBracketId bracket_id, uint8 actionMask, bool isRated, uint32 arenaRatedTeamId)
void BattlegroundQueue::BattlegroundQueueUpdate(BattlegroundBracketId bracket_id, bool isRated, uint32 arenaRatedTeamId)
{
// if no players in queue - do nothing
if (IsAllQueuesEmpty(bracket_id))
@@ -685,7 +685,7 @@ void BattlegroundQueue::BattlegroundQueueUpdate(BattlegroundBracketId bracket_id
return;
// battlegrounds with free slots should be populated first using players in queue
if ((actionMask & 0x01) && !BattlegroundMgr::IsArenaType(m_bgTypeId))
if (!BattlegroundMgr::IsArenaType(m_bgTypeId))
{
const BattlegroundContainer& bgList = sBattlegroundMgr->GetBattlegroundList();
BattlegroundNeedSet bgsToCheck;
@@ -722,9 +722,6 @@ void BattlegroundQueue::BattlegroundQueueUpdate(BattlegroundBracketId bracket_id
// finished iterating through battlegrounds with free slots, maybe we need to create a new bg
if ((actionMask & 0x02) == 0)
return;
// get min and max players per team
uint32 MinPlayersPerTeam = bg_template->GetMinPlayersPerTeam();
uint32 MaxPlayersPerTeam = bg_template->GetMaxPlayersPerTeam();