From e743f4a479ce7ddd3f13d51ca1c19a591c803fc0 Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Sun, 5 Apr 2015 22:03:40 +0300 Subject: Core/LFGMgr: Fix the case where the last player left in a lfg group would be stuck in party when porting out of the instance. If you find a better way or think this is wrong feel free to remove it or improve it. --- src/server/game/DungeonFinding/LFGMgr.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index a2058fffeed..7112aaeaaee 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1266,6 +1266,14 @@ 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 disband when porting out of the instance + if (group->GetMembersCount() == 1) + { + group->Disband(); + TC_LOG_DEBUG("lfg.teleport", "Player %s is last in lfggroup so we disband the group.", + player->GetName().c_str()); + } + return; } -- cgit v1.2.3