fix(Core): Crashfix. (#11346)

Fixes #11281
This commit is contained in:
UltraNix
2022-04-11 16:16:34 +02:00
committed by GitHub
parent 54d1ed0e63
commit 3d4f9d6a18

View File

@@ -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;