From 1019649f93ae8f45f0d15a9eeeb803901c3c15cf Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Wed, 15 Apr 2015 20:37:18 +0300 Subject: Core/LFGMgr: One more addition to fix the crash on logout. --- src/server/game/DungeonFinding/LFGMgr.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index e971b99034b..9d1eecabd66 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1266,13 +1266,13 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false* if (player->GetMapId() == uint32(dungeon->map)) player->TeleportToBGEntryPoint(); - // in the case were we are the last in lfggroup then we must leave the queue and group when porting out of the instance - if (group && group->GetMembersCount() == 1) + // in the case were we are the last in the lfggroup then we must disband the lfggroup when porting out of the instance + // only when the player is not logging out.on logout, the core does it's own magic + if (!player->GetSession()->isLogingOut() && group->GetMembersCount() == 1) { - sLFGMgr->LeaveLfg(player->GetGUID()); - group->RemoveMember(player->GetGUID()); - TC_LOG_DEBUG("lfg.teleport", "Player %s is last in lfggroup so we leave the queue and the group.", - player->GetName().c_str()); + group->Disband(); + TC_LOG_DEBUG("lfg.teleport", "Player %s(%s) is last in the lfggroup so we disband the group.", + player->GetName().c_str(), player->GetGUID().ToString().c_str()); } return; -- cgit v1.2.3