fix(Core/Misc): Remove from LFG/batleground queues when teleported to battleground/LFG dungeon. (#10740)

Players cannot queue up for battleground during LFG dungeon.
Players cannot queue up for LFG dungeon during battleground/arena match.
Fixes #10635
This commit is contained in:
UltraNix
2022-02-20 16:33:04 +01:00
committed by GitHub
parent 3e6424151a
commit 9d12652c3e
4 changed files with 57 additions and 20 deletions

View File

@@ -1930,8 +1930,11 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
return ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS;
// check if someone in party is using dungeon system
if (member->isUsingLfg())
lfg::LfgState lfgState = sLFGMgr->GetState(member->GetGUID());
if (lfgState > lfg::LFG_STATE_NONE && (lfgState != lfg::LFG_STATE_QUEUED || !sWorld->getBoolConfig(CONFIG_ALLOW_JOIN_BG_AND_LFG)))
{
return ERR_LFG_CANT_USE_BATTLEGROUND;
}
// pussywizard: prevent joining when any member is in bg/arena
if (member->InBattleground())