From 3d4f9d6a180c3e3c59176989ad7136069e6eaa09 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 11 Apr 2022 16:16:34 +0200 Subject: [PATCH] fix(Core): Crashfix. (#11346) Fixes #11281 --- src/server/game/Groups/Group.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 5d79b504a..2c010c7d2 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1871,7 +1871,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed) } } -GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* bgTemplate, BattlegroundQueueTypeId /*bgQueueTypeId*/, uint32 MinPlayerCount, uint32 /*MaxPlayerCount*/, bool isRated, uint32 arenaSlot) +GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* bgTemplate, BattlegroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 /*MaxPlayerCount*/, bool isRated, uint32 arenaSlot) { // check if this group is LFG group if (isLFGGroup()) @@ -1944,6 +1944,12 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* if (!member->HasFreeBattlegroundQueueId()) return ERR_BATTLEGROUND_TOO_MANY_QUEUES; + // don't let join if someone from the group is already in that bg queue + if (member->InBattlegroundQueueForBattlegroundQueueType(bgQueueTypeId)) + { + return ERR_BATTLEGROUND_JOIN_FAILED; + } + // don't let join if someone from the group is in bg queue random if (member->InBattlegroundQueueForBattlegroundQueueType(bgQueueTypeIdRandom)) return ERR_IN_RANDOM_BG;