Core/Dungeon Finder: Do not allow to join Queue if someone in party is using Battleground/Arena System
Core/Dungeon Finder: Minor code style fix --HG-- branch : trunk
This commit is contained in:
@@ -408,24 +408,26 @@ void LFGMgr::Update(uint32 diff)
|
|||||||
role = ROLE_NONE;
|
role = ROLE_NONE;
|
||||||
for (LfgRolesMap::const_iterator itPlayer = queue->roles.begin(); itPlayer != queue->roles.end(); ++itPlayer)
|
for (LfgRolesMap::const_iterator itPlayer = queue->roles.begin(); itPlayer != queue->roles.end(); ++itPlayer)
|
||||||
role |= itPlayer->second;
|
role |= itPlayer->second;
|
||||||
|
role &= ~ROLE_LEADER;
|
||||||
|
|
||||||
|
switch(role)
|
||||||
|
{
|
||||||
|
case ROLE_NONE: // Should not happen - just in case
|
||||||
waitTime = -1;
|
waitTime = -1;
|
||||||
if (role & ROLE_TANK)
|
break;
|
||||||
{
|
case ROLE_TANK:
|
||||||
if (role & ROLE_HEALER || role & ROLE_DAMAGE)
|
|
||||||
waitTime = m_WaitTimeAvg;
|
|
||||||
else
|
|
||||||
waitTime = m_WaitTimeTank;
|
waitTime = m_WaitTimeTank;
|
||||||
}
|
break;
|
||||||
else if (role & ROLE_HEALER)
|
case ROLE_HEALER:
|
||||||
{
|
|
||||||
if (role & ROLE_DAMAGE)
|
|
||||||
waitTime = m_WaitTimeAvg;
|
|
||||||
else
|
|
||||||
waitTime = m_WaitTimeHealer;
|
waitTime = m_WaitTimeHealer;
|
||||||
}
|
break;
|
||||||
else if (role & ROLE_DAMAGE)
|
case ROLE_DAMAGE:
|
||||||
waitTime = m_WaitTimeDps;
|
waitTime = m_WaitTimeDps;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
waitTime = m_WaitTimeAvg;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
for (LfgRolesMap::const_iterator itPlayer = queue->roles.begin(); itPlayer != queue->roles.end(); ++itPlayer)
|
for (LfgRolesMap::const_iterator itPlayer = queue->roles.begin(); itPlayer != queue->roles.end(); ++itPlayer)
|
||||||
if (Player* plr = sObjectMgr.GetPlayerByLowGUID(itPlayer->first))
|
if (Player* plr = sObjectMgr.GetPlayerByLowGUID(itPlayer->first))
|
||||||
@@ -533,7 +535,7 @@ void LFGMgr::Join(Player* plr)
|
|||||||
else // Check if all dungeons are valid
|
else // Check if all dungeons are valid
|
||||||
{
|
{
|
||||||
LfgType type = LFG_TYPE_NONE;
|
LfgType type = LFG_TYPE_NONE;
|
||||||
for (LfgDungeonSet::const_iterator it = dungeons->begin(); it != dungeons->end(); ++it)
|
for (LfgDungeonSet::const_iterator it = dungeons->begin(); it != dungeons->end() && result == LFG_JOIN_OK; ++it)
|
||||||
{
|
{
|
||||||
type = GetDungeonType(*it);
|
type = GetDungeonType(*it);
|
||||||
switch(type)
|
switch(type)
|
||||||
@@ -578,6 +580,8 @@ void LFGMgr::Join(Player* plr)
|
|||||||
result = LFG_JOIN_PARTY_DESERTER;
|
result = LFG_JOIN_PARTY_DESERTER;
|
||||||
else if (plrg->HasAura(LFG_SPELL_DUNGEON_COOLDOWN))
|
else if (plrg->HasAura(LFG_SPELL_DUNGEON_COOLDOWN))
|
||||||
result = LFG_JOIN_PARTY_RANDOM_COOLDOWN;
|
result = LFG_JOIN_PARTY_RANDOM_COOLDOWN;
|
||||||
|
else if (plrg->InBattleground() || plrg->InArena() || plrg->InBattlegroundQueue())
|
||||||
|
result = LFG_JOIN_USING_BG_SYSTEM;
|
||||||
++memberCount;
|
++memberCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1455,7 +1459,7 @@ bool LFGMgr::CheckGroupRoles(LfgRolesMap &groles, bool removeLeaderFlag /*= true
|
|||||||
damage++;
|
damage++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (tank + healer + damage) == groles.size();
|
return (tank + healer + damage) == uint8(groles.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user