mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user