feat(Core/BG): allow MinPlayersPerTeam override for low-levels (#20083)

This commit is contained in:
Francesco Borzì
2024-09-29 14:07:45 +02:00
committed by GitHub
parent 5a96ce283d
commit 34a3b4ee47
8 changed files with 59 additions and 4 deletions

View File

@@ -31,6 +31,8 @@
#include "ScriptMgr.h"
#include <unordered_map>
#include "BattlegroundUtils.h"
/*********************************************************/
/*** BATTLEGROUND QUEUE SYSTEM ***/
/*********************************************************/
@@ -760,7 +762,7 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 diff, BattlegroundTypeId
}
// get min and max players per team
uint32 MinPlayersPerTeam = bg_template->GetMinPlayersPerTeam();
uint32 MinPlayersPerTeam = GetMinPlayersPerTeam(bg_template, bracketEntry);
uint32 MaxPlayersPerTeam = bg_template->GetMaxPlayersPerTeam();
if (bg_template->isArena())
@@ -996,7 +998,7 @@ void BattlegroundQueue::BattlegroundQueueAnnouncerUpdate(uint32 diff, Battlegrou
_queueAnnouncementTimer[bracket_id] = -1;
auto bgName = bg_template->GetName();
uint32 MaxPlayers = bg_template->GetMinPlayersPerTeam() * 2;
uint32 MaxPlayers = GetMinPlayersPerTeam(bg_template, bracketEntry) * 2;
uint32 q_min_level = std::min(bracketEntry->minLevel, (uint32) 80);
uint32 q_max_level = std::min(bracketEntry->maxLevel, (uint32) 80);
@@ -1047,7 +1049,7 @@ void BattlegroundQueue::SendMessageBGQueue(Player* leader, Battleground* bg, PvP
BattlegroundBracketId bracketId = bracketEntry->GetBracketId();
auto bgName = bg->GetName();
uint32 MinPlayers = bg->GetMinPlayersPerTeam();
uint32 MinPlayers = GetMinPlayersPerTeam(bg, bracketEntry);
uint32 MaxPlayers = MinPlayers * 2;
uint32 q_min_level = std::min(bracketEntry->minLevel, (uint32)80);
uint32 q_max_level = std::min(bracketEntry->maxLevel, (uint32)80);