diff --git a/src/game/LFG/LFGQueue.cpp b/src/game/LFG/LFGQueue.cpp index 4cd96053cf..9a92f7678c 100644 --- a/src/game/LFG/LFGQueue.cpp +++ b/src/game/LFG/LFGQueue.cpp @@ -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) @@ -552,36 +552,40 @@ bool LFGQueue::GroupUpdateQueueStatus(ObjectGuid playerGuid, ObjectGuid leaderGu void LFGQueue::GroupUpdateUI(ObjectGuid leaderGuid, bool completed) { + std::vector 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 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(); } }); }