From 64e0867c281cf2d812159a2ae4d15423394149d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesco=20Borz=C3=AC?= Date: Fri, 5 Jun 2020 16:40:15 +0200 Subject: [PATCH] fix(Core/BG): do not start new BGs if there are BGs with free slots (#3082) --- src/server/game/Battlegrounds/BattlegroundQueue.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index 9b0c9f634..47a8632be 100644 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -712,6 +712,12 @@ void BattlegroundQueue::BattlegroundQueueUpdate(BattlegroundBracketId bracket_id for (auto itr : m_SelectionPools[TEAM_ALLIANCE + i].SelectedGroups) BattlegroundMgr::InviteGroupToBG(itr, bg, itr->RealTeamID); } + + // prevent new BGs to be created if there are some non-empty BGs running + // TODO: note that this is a workaround, + // however it shouldn't cause issues as the queue update is constantly called + if (!bg_template->isArena() && !bgsToCheck.empty()) + return; } // finished iterating through battlegrounds with free slots, maybe we need to create a new bg