aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/DungeonFinding/LFGMgr.cpp4
-rw-r--r--src/server/game/DungeonFinding/LFGMgr.h2
-rw-r--r--src/server/game/DungeonFinding/LFGScripts.cpp2
-rw-r--r--src/server/game/Server/WorldSession.h1
4 files changed, 6 insertions, 3 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index 0c89465fc60..68798d43e38 100644
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -583,7 +583,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
@param[in] guid Player or group guid
*/
-void LFGMgr::LeaveLfg(ObjectGuid guid)
+void LFGMgr::LeaveLfg(ObjectGuid guid, bool disconnected)
{
ObjectGuid gguid = guid.IsParty() ? guid : GetGroup(guid);
@@ -644,7 +644,7 @@ void LFGMgr::LeaveLfg(ObjectGuid guid)
break;
case LFG_STATE_DUNGEON:
case LFG_STATE_FINISHED_DUNGEON:
- if (guid != gguid) // Player
+ if (guid != gguid && !disconnected) // Player
SetState(guid, LFG_STATE_NONE);
break;
}
diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h
index 34996410fbe..01e598e5c7f 100644
--- a/src/server/game/DungeonFinding/LFGMgr.h
+++ b/src/server/game/DungeonFinding/LFGMgr.h
@@ -405,7 +405,7 @@ class LFGMgr
/// Join Lfg with selected roles, dungeons and comment
void JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, std::string const& comment);
/// Leaves lfg
- void LeaveLfg(ObjectGuid guid);
+ void LeaveLfg(ObjectGuid guid, bool disconnected = false);
// LfgQueue
/// Get last lfg state (NONE, DUNGEON or FINISHED_DUNGEON)
diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp
index c77ab9a36c5..42e1f4a545f 100644
--- a/src/server/game/DungeonFinding/LFGScripts.cpp
+++ b/src/server/game/DungeonFinding/LFGScripts.cpp
@@ -44,6 +44,8 @@ void LFGPlayerScript::OnLogout(Player* player)
player->GetSession()->SendLfgLfrList(false);
sLFGMgr->LeaveLfg(player->GetGUID());
}
+ else if (player->GetSession()->PlayerDisconnected())
+ sLFGMgr->LeaveLfg(player->GetGUID(), true);
}
void LFGPlayerScript::OnLogin(Player* player, bool /*loginFirst*/)
diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h
index 5cdfe92746b..4a2466f26b2 100644
--- a/src/server/game/Server/WorldSession.h
+++ b/src/server/game/Server/WorldSession.h
@@ -807,6 +807,7 @@ class WorldSession
bool PlayerLogout() const { return m_playerLogout; }
bool PlayerLogoutWithSave() const { return m_playerLogout && m_playerSave; }
bool PlayerRecentlyLoggedOut() const { return m_playerRecentlyLogout; }
+ bool PlayerDisconnected() const { return !m_Socket; }
void ReadAddonsInfo(ByteBuffer& data);
void SendAddonsInfo();