Core/Battleground: Do not allow to join queue if anyone in the party is using dungeon system
--HG-- branch : trunk
This commit is contained in:
@@ -1591,6 +1591,10 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed)
|
|||||||
|
|
||||||
GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* bgOrTemplate, BattlegroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 /*MaxPlayerCount*/, bool isRated, uint32 arenaSlot)
|
GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* bgOrTemplate, BattlegroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 /*MaxPlayerCount*/, bool isRated, uint32 arenaSlot)
|
||||||
{
|
{
|
||||||
|
// check if this group is LFG group
|
||||||
|
if (isLFGGroup())
|
||||||
|
return ERR_LFG_CANT_USE_BATTLEGROUND;
|
||||||
|
|
||||||
BattlemasterListEntry const* bgEntry = sBattlemasterListStore.LookupEntry(bgOrTemplate->GetTypeID());
|
BattlemasterListEntry const* bgEntry = sBattlemasterListStore.LookupEntry(bgOrTemplate->GetTypeID());
|
||||||
if (!bgEntry)
|
if (!bgEntry)
|
||||||
return ERR_GROUP_JOIN_BATTLEGROUND_FAIL; // shouldn't happen
|
return ERR_GROUP_JOIN_BATTLEGROUND_FAIL; // shouldn't happen
|
||||||
@@ -1649,6 +1653,9 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
|
|||||||
// check if member can join any more battleground queues
|
// check if member can join any more battleground queues
|
||||||
if (!member->HasFreeBattlegroundQueueId())
|
if (!member->HasFreeBattlegroundQueueId())
|
||||||
return ERR_BATTLEGROUND_TOO_MANY_QUEUES; // not blizz-like
|
return ERR_BATTLEGROUND_TOO_MANY_QUEUES; // not blizz-like
|
||||||
|
// check if someone in party is using dungeon system
|
||||||
|
if (member->isUsingLfg())
|
||||||
|
return ERR_LFG_CANT_USE_BATTLEGROUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
// only check for MinPlayerCount since MinPlayerCount == MaxPlayerCount for arenas...
|
// only check for MinPlayerCount since MinPlayerCount == MaxPlayerCount for arenas...
|
||||||
|
|||||||
@@ -99,15 +99,6 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data)
|
|||||||
|
|
||||||
sLog.outDebug("WORLD: Recvd CMSG_BATTLEMASTER_JOIN Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid)));
|
sLog.outDebug("WORLD: Recvd CMSG_BATTLEMASTER_JOIN Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid)));
|
||||||
|
|
||||||
// player is using dungeon finder or raid finder
|
|
||||||
if (GetPlayer()->isUsingLfg())
|
|
||||||
{
|
|
||||||
WorldPacket data;
|
|
||||||
sBattlegroundMgr.BuildGroupJoinedBattlegroundPacket(&data, ERR_LFG_CANT_USE_BATTLEGROUND);
|
|
||||||
GetPlayer()->GetSession()->SendPacket(&data);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// can do this, since it's battleground, not arena
|
// can do this, since it's battleground, not arena
|
||||||
BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(bgTypeId, 0);
|
BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(bgTypeId, 0);
|
||||||
BattlegroundQueueTypeId bgQueueTypeIdRandom = BattlegroundMgr::BGQueueTypeId(BATTLEGROUND_RB, 0);
|
BattlegroundQueueTypeId bgQueueTypeIdRandom = BattlegroundMgr::BGQueueTypeId(BATTLEGROUND_RB, 0);
|
||||||
@@ -136,6 +127,15 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data)
|
|||||||
// check queue conditions
|
// check queue conditions
|
||||||
if (!joinAsGroup)
|
if (!joinAsGroup)
|
||||||
{
|
{
|
||||||
|
if (GetPlayer()->isUsingLfg())
|
||||||
|
{
|
||||||
|
// player is using dungeon finder or raid finder
|
||||||
|
WorldPacket data;
|
||||||
|
sBattlegroundMgr.BuildGroupJoinedBattlegroundPacket(&data, ERR_LFG_CANT_USE_BATTLEGROUND);
|
||||||
|
GetPlayer()->GetSession()->SendPacket(&data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// check Deserter debuff
|
// check Deserter debuff
|
||||||
if (!_player->CanJoinToBattleground())
|
if (!_player->CanJoinToBattleground())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user