mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Battleground: allow Random battleground and arena queues same time. (#21730)
- It also restricts queuing to arenas if it is in queue of dungeon finder
(cherry picked from commit 8aad6f828e)
This commit is contained in:
@@ -24833,10 +24833,11 @@ uint32 Player::GetBattlegroundQueueJoinTime(BattlegroundQueueTypeId bgQueueTypeI
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Player::InBattlegroundQueue() const
|
||||
bool Player::InBattlegroundQueue(bool ignoreArena) const
|
||||
{
|
||||
for (uint8 i = 0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)
|
||||
if (m_bgBattlegroundQueueID[i].bgQueueTypeId != BATTLEGROUND_QUEUE_NONE)
|
||||
if (m_bgBattlegroundQueueID[i].bgQueueTypeId != BATTLEGROUND_QUEUE_NONE
|
||||
&& (!ignoreArena || m_bgBattlegroundQueueID[i].bgQueueTypeId.BattlemasterListId != BATTLEGROUND_AA))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2267,7 +2267,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
Battleground* GetBattleground() const;
|
||||
|
||||
uint32 GetBattlegroundQueueJoinTime(BattlegroundQueueTypeId bgQueueTypeId) const;
|
||||
bool InBattlegroundQueue() const;
|
||||
bool InBattlegroundQueue(bool ignoreArena = false) const;
|
||||
BattlegroundQueueTypeId GetBattlegroundQueueTypeId(uint32 index) const;
|
||||
uint32 GetBattlegroundQueueIndex(BattlegroundQueueTypeId bgQueueTypeId) const;
|
||||
bool IsInvitedForBattlegroundQueueType(BattlegroundQueueTypeId bgQueueTypeId) const;
|
||||
|
||||
@@ -1849,7 +1849,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
|
||||
if (isInRandomBgQueue)
|
||||
return ERR_IN_RANDOM_BG;
|
||||
// don't let join to bg queue random if someone from the group is already in bg queue
|
||||
if ((bgOrTemplate->GetTypeID() == BATTLEGROUND_RB || bgOrTemplate->GetTypeID() == BATTLEGROUND_RANDOM_EPIC) && member->InBattlegroundQueue() && !isInRandomBgQueue)
|
||||
if ((bgOrTemplate->GetTypeID() == BATTLEGROUND_RB || bgOrTemplate->GetTypeID() == BATTLEGROUND_RANDOM_EPIC) && member->InBattlegroundQueue(true) && !isInRandomBgQueue)
|
||||
return ERR_IN_NON_RANDOM_BG;
|
||||
// check for deserter debuff in case not arena queue
|
||||
if (bgOrTemplate->GetTypeID() != BATTLEGROUND_AA && !member->CanJoinToBattleground(bgOrTemplate))
|
||||
|
||||
@@ -139,7 +139,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPackets::Battleground::Batt
|
||||
return;
|
||||
}
|
||||
|
||||
if (_player->InBattlegroundQueue() && !isInRandomBgQueue && (bgTypeId == BATTLEGROUND_RB || bgTypeId == BATTLEGROUND_RANDOM_EPIC))
|
||||
if (_player->InBattlegroundQueue(true) && !isInRandomBgQueue && (bgTypeId == BATTLEGROUND_RB || bgTypeId == BATTLEGROUND_RANDOM_EPIC))
|
||||
{
|
||||
// player is already in queue, can't start random queue
|
||||
WorldPackets::Battleground::BattlefieldStatusFailed battlefieldStatus;
|
||||
|
||||
Reference in New Issue
Block a user