Skip to content

Commit

Permalink
Properly check if player is queued for a given BG in SendWorldTextToB…
Browse files Browse the repository at this point in the history
…GAndQueue. (#2606)
  • Loading branch information
GrenderG authored May 4, 2024
1 parent 7c59e79 commit 7e38088
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/game/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2247,7 +2247,8 @@ void World::SendWorldText(int32 string_id, ...)
// Send a System Message to all players in the same battleground or queue (except self if mentioned)
void World::SendWorldTextToBGAndQueue(int32 string_id, uint32 queuedPlayerLevel, uint32 queueType, ...)
{
BattleGroundTypeId bgTypeId = BattleGroundMgr::BgTemplateId(static_cast<BattleGroundQueueTypeId>(queueType));
auto queueTypeId = static_cast<BattleGroundQueueTypeId>(queueType);
BattleGroundTypeId bgTypeId = BattleGroundMgr::BgTemplateId(queueTypeId);
BattleGroundBracketId queuedPlayerBracket = Player::GetBattleGroundBracketIdFromLevel(bgTypeId, queuedPlayerLevel);

va_list ap;
Expand All @@ -2270,7 +2271,7 @@ void World::SendWorldTextToBGAndQueue(int32 string_id, uint32 queuedPlayerLevel,
}

// If player is queued or already inside a BG matching the BG type.
if ((player->InBattleGroundQueue() && player->GetQueuedBattleground() == queueType) ||
if (player->InBattleGroundQueueForBattleGroundQueueType(queueTypeId) ||
(player->InBattleGround() && player->GetBattleGroundTypeId() == bgTypeId))
{
// If player bracket matches the queued player bracket.
Expand Down

0 comments on commit 7e38088

Please sign in to comment.