Skip to content

Commit

Permalink
Fix TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Sep 9, 2024
1 parent 3732128 commit 58de916
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/game/LFG/LFGQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void LFGQueue::StopLookingForGroup(ObjectGuid leaderGuid, ObjectGuid playerGuid)

SendLFGUpdate(leaderGuid, playerGuid);

// TODO: Send out packets
GroupUpdateUI(leaderGuid, true);
}

void LFGQueue::TryJoin(ObjectGuid playerGuid, bool initial)
Expand Down Expand Up @@ -552,36 +552,40 @@ bool LFGQueue::GroupUpdateQueueStatus(ObjectGuid playerGuid, ObjectGuid leaderGu

void LFGQueue::GroupUpdateUI(ObjectGuid leaderGuid, bool completed)
{
std::vector<ObjectGuid> members;

auto itr = m_queuedPlayers.find(leaderGuid);
if (itr == m_queuedPlayers.end())
return;
if (itr != m_queuedPlayers.end())
{
auto& info = itr->second;

auto& info = itr->second;
std::vector<ObjectGuid> members;
for (auto& member : info.members)
members.push_back(member.partyMember);
for (auto& member : info.members)
members.push_back(member.partyMember);
}

sWorld.GetMessager().AddMessage([leaderGuid, completed, members](World* world)
{
Player* player = sObjectMgr.GetPlayer(leaderGuid);

if (completed)
{
player->GetSession()->SendMeetingStoneComplete();
if (sWorld.getConfig(CONFIG_BOOL_CHANNEL_RESTRICTED_LFG) && player->GetSession()->GetSecurity() == SEC_PLAYER)
player->LeaveLFGChannel();
}
else
player->GetSession()->SendLFGUpdate();

if (sWorld.getConfig(CONFIG_BOOL_CHANNEL_RESTRICTED_LFG) && player->GetSession()->GetSecurity() == SEC_PLAYER)
player->LeaveLFGChannel();

for (auto& member : members)
{
if (completed)
{
player->GetSession()->SendMeetingStoneComplete();
if (sWorld.getConfig(CONFIG_BOOL_CHANNEL_RESTRICTED_LFG) && player->GetSession()->GetSecurity() == SEC_PLAYER)
player->LeaveLFGChannel();
}
else
player->GetSession()->SendLFGUpdate();

if (sWorld.getConfig(CONFIG_BOOL_CHANNEL_RESTRICTED_LFG) && player->GetSession()->GetSecurity() == SEC_PLAYER)
player->LeaveLFGChannel();
}
});
}
Expand Down

0 comments on commit 58de916

Please sign in to comment.