aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/DungeonFinding/LFGMgr.cpp9
-rw-r--r--src/server/game/DungeonFinding/LFGScripts.cpp10
2 files changed, 10 insertions, 9 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index 9d1eecabd66..f07e4e7113f 100644
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -1266,15 +1266,6 @@ 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 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)
- {
- 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;
}
diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp
index ae64e59936f..852eb7d8c5f 100644
--- a/src/server/game/DungeonFinding/LFGScripts.cpp
+++ b/src/server/game/DungeonFinding/LFGScripts.cpp
@@ -99,7 +99,17 @@ void LFGPlayerScript::OnMapChanged(Player* player)
player->CastSpell(player, LFG_SPELL_LUCK_OF_THE_DRAW, true);
}
else
+ {
+ Group* group = player->GetGroup();
+ if (group && group->GetMembersCount() == 1)
+ {
+ sLFGMgr->LeaveLfg(group->GetGUID());
+ group->Disband();
+ TC_LOG_DEBUG("lfg", "LFGPlayerScript::OnMapChanged, Player %s(%s) is last in the lfggroup so we disband the group.",
+ player->GetName().c_str(), player->GetGUID().ToString().c_str());
+ }
player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW);
+ }
}
LFGGroupScript::LFGGroupScript() : GroupScript("LFGGroupScript") { }