summaryrefslogtreecommitdiff
path: root/src/server/game/DungeonFinding/LFGMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/DungeonFinding/LFGMgr.cpp')
-rw-r--r--src/server/game/DungeonFinding/LFGMgr.cpp33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index 2449fada7a..2d116909ae 100644
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -961,7 +961,7 @@ namespace lfg
RBCacheMap::iterator itr = RBCacheStore[player->GetTeamId()].find(dungeonId);
if (itr != RBCacheStore[player->GetTeamId()].end())
{
- player->GetSession()->SendPacket(&(itr->second));
+ player->SendDirectMessage(&(itr->second));
return;
}
// send empty packet if cache not found
@@ -973,7 +973,7 @@ namespace lfg
data << (uint32)0;
data << (uint32)0;
data << (uint32)0;
- player->GetSession()->SendPacket(&data);
+ player->SendDirectMessage(&data);
}
void LFGMgr::UpdateRaidBrowser(uint32 diff)
@@ -1220,7 +1220,7 @@ namespace lfg
for (RBSearchersMap::const_iterator sitr = RBSearchersStore[team].begin(); sitr != RBSearchersStore[team].end(); ++sitr)
if (sitr->second == dungeonId)
if (Player* p = ObjectAccessor::FindConnectedPlayer(sitr->first))
- p->GetSession()->SendPacket(&differencePacket);
+ p->SendDirectMessage(&differencePacket);
break; // one dungeon updated in one LFGMgr::UpdateRaidBrowser
}
@@ -1508,7 +1508,7 @@ namespace lfg
lockMap.clear();
}
- uint8 LFGMgr::CheckGroupRoles(LfgRolesMap& groles, bool removeLeaderFlag /*= true*/)
+ uint8 LFGMgr::CheckGroupRoles(LfgRolesMap& groles)
{
if (groles.empty())
return 0;
@@ -1517,21 +1517,18 @@ namespace lfg
uint8 tank = 0;
uint8 healer = 0;
- if (removeLeaderFlag)
- for (LfgRolesMap::iterator it = groles.begin(); it != groles.end(); ++it)
- it->second &= ~PLAYER_ROLE_LEADER;
-
for (LfgRolesMap::iterator it = groles.begin(); it != groles.end(); ++it)
{
- if (it->second == PLAYER_ROLE_NONE)
+ uint8 const role = it->second & ~PLAYER_ROLE_LEADER;
+ if (role == PLAYER_ROLE_NONE)
return 0;
- if (it->second & PLAYER_ROLE_DAMAGE)
+ if (role & PLAYER_ROLE_DAMAGE)
{
- if (it->second != PLAYER_ROLE_DAMAGE)
+ if (role != PLAYER_ROLE_DAMAGE)
{
it->second -= PLAYER_ROLE_DAMAGE;
- if (uint8 x = CheckGroupRoles(groles, false))
+ if (uint8 x = CheckGroupRoles(groles))
return x;
it->second += PLAYER_ROLE_DAMAGE;
}
@@ -1541,12 +1538,12 @@ namespace lfg
damage++;
}
- if (it->second & PLAYER_ROLE_HEALER)
+ if (role & PLAYER_ROLE_HEALER)
{
- if (it->second != PLAYER_ROLE_HEALER)
+ if (role != PLAYER_ROLE_HEALER)
{
it->second -= PLAYER_ROLE_HEALER;
- if (uint8 x = CheckGroupRoles(groles, false))
+ if (uint8 x = CheckGroupRoles(groles))
return x;
it->second += PLAYER_ROLE_HEALER;
}
@@ -1556,12 +1553,12 @@ namespace lfg
healer++;
}
- if (it->second & PLAYER_ROLE_TANK)
+ if (role & PLAYER_ROLE_TANK)
{
- if (it->second != PLAYER_ROLE_TANK)
+ if (role != PLAYER_ROLE_TANK)
{
it->second -= PLAYER_ROLE_TANK;
- if (uint8 x = CheckGroupRoles(groles, false))
+ if (uint8 x = CheckGroupRoles(groles))
return x;
it->second += PLAYER_ROLE_TANK;
}