diff options
| author | w1sht0l1v3 <w1sht0l1v3@gmail.com> | 2015-04-23 22:10:15 +0300 |
|---|---|---|
| committer | w1sht0l1v3 <w1sht0l1v3@gmail.com> | 2015-04-23 22:10:15 +0300 |
| commit | 837a0a75246b177858825caf1861dd61a6b87868 (patch) | |
| tree | ddc30b9a02cd24bc18edd68b207c3c1feffe8406 /src | |
| parent | 4e0dec7fd26452e60055eb2fa9461d39ec49d45b (diff) | |
Core/LFG: Move code to a better place.
(the case where the last player left inside a dungeon would not be removed from lfg&group when he ports outside)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/DungeonFinding/LFGMgr.cpp | 9 | ||||
| -rw-r--r-- | src/server/game/DungeonFinding/LFGScripts.cpp | 10 |
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") { } |
