mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 12:47:07 +00:00
fix(Core/Battlegrounds): Fixed timed announcement system for CrossfactionBG module. (#8521)
- Closes #6637
This commit is contained in:
@@ -47,6 +47,7 @@ BattlegroundQueue::BattlegroundQueue() : m_bgTypeId(BATTLEGROUND_TYPE_NONE), m_a
|
||||
}
|
||||
|
||||
_queueAnnouncementTimer.fill(-1);
|
||||
_queueAnnouncementCrossfactioned = false;
|
||||
}
|
||||
|
||||
BattlegroundQueue::~BattlegroundQueue()
|
||||
@@ -955,7 +956,17 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 diff, BattlegroundBracket
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_TIMED))
|
||||
{
|
||||
uint32 qPlayers = GetPlayersCountInGroupsQueue(bracket_id, BG_QUEUE_NORMAL_HORDE) + GetPlayersCountInGroupsQueue(bracket_id, BG_QUEUE_NORMAL_ALLIANCE);
|
||||
uint32 qPlayers = 0;
|
||||
|
||||
if (_queueAnnouncementCrossfactioned)
|
||||
{
|
||||
qPlayers = GetPlayersCountInGroupsQueue(bracket_id, BG_QUEUE_CFBG);
|
||||
}
|
||||
else
|
||||
{
|
||||
qPlayers = GetPlayersCountInGroupsQueue(bracket_id, BG_QUEUE_NORMAL_HORDE) + GetPlayersCountInGroupsQueue(bracket_id, BG_QUEUE_NORMAL_ALLIANCE);
|
||||
}
|
||||
|
||||
if (!qPlayers)
|
||||
{
|
||||
_queueAnnouncementTimer[bracket_id] = -1;
|
||||
@@ -1150,6 +1161,17 @@ void BattlegroundQueue::SendExitMessageArenaQueue(GroupQueueInfo* ginfo)
|
||||
sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, TeamName.c_str(), ArenaType, ArenaType, ArenaTeamRating);
|
||||
}
|
||||
|
||||
void BattlegroundQueue::SetQueueAnnouncementTimer(uint32 bracketId, int32 timer)
|
||||
{
|
||||
_queueAnnouncementTimer[bracketId] = timer;
|
||||
_queueAnnouncementCrossfactioned = true;
|
||||
}
|
||||
|
||||
int32 BattlegroundQueue::GetQueueAnnouncementTimer(uint32 bracketId) const
|
||||
{
|
||||
return _queueAnnouncementTimer[bracketId];
|
||||
}
|
||||
|
||||
/*********************************************************/
|
||||
/*** BATTLEGROUND QUEUE EVENTS ***/
|
||||
/*********************************************************/
|
||||
|
||||
@@ -56,6 +56,8 @@ enum BattlegroundQueueGroupTypes
|
||||
BG_QUEUE_NORMAL_ALLIANCE,
|
||||
BG_QUEUE_NORMAL_HORDE,
|
||||
|
||||
BG_QUEUE_CFBG,
|
||||
|
||||
BG_QUEUE_MAX = 10
|
||||
};
|
||||
|
||||
@@ -128,8 +130,8 @@ public:
|
||||
ArenaType GetArenaType() { return m_arenaType; }
|
||||
BattlegroundTypeId GetBGTypeID() { return m_bgTypeId; }
|
||||
|
||||
void SetQueueAnnouncementTimer(uint32 bracketId, int32 timer) { _queueAnnouncementTimer[bracketId] = timer; }
|
||||
[[nodiscard]] int32 GetQueueAnnouncementTimer(uint32 bracketId) { return _queueAnnouncementTimer[bracketId]; }
|
||||
void SetQueueAnnouncementTimer(uint32 bracketId, int32 timer);
|
||||
[[nodiscard]] int32 GetQueueAnnouncementTimer(uint32 bracketId) const;
|
||||
|
||||
private:
|
||||
BattlegroundTypeId m_bgTypeId;
|
||||
@@ -141,6 +143,7 @@ private:
|
||||
EventProcessor m_events;
|
||||
|
||||
std::array<int32, BG_BRACKET_ID_LAST> _queueAnnouncementTimer;
|
||||
bool _queueAnnouncementCrossfactioned;
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user