From 7e38088bb155c8dd4be588da1d8dfdf4b49252c2 Mon Sep 17 00:00:00 2001 From: GrenderG Date: Sat, 4 May 2024 12:58:22 +0200 Subject: [PATCH] Properly check if player is queued for a given BG in SendWorldTextToBGAndQueue. (#2606) --- src/game/World.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/game/World.cpp b/src/game/World.cpp index 18ee1ec4029..401e54568e4 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -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(queueType)); + auto queueTypeId = static_cast(queueType); + BattleGroundTypeId bgTypeId = BattleGroundMgr::BgTemplateId(queueTypeId); BattleGroundBracketId queuedPlayerBracket = Player::GetBattleGroundBracketIdFromLevel(bgTypeId, queuedPlayerLevel); va_list ap; @@ -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.