diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index b11d8194f9..a439e7576f 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -416,10 +416,6 @@ bool LFGMgr::RemoveFromQueue(const uint64& guid) void LFGMgr::InitializeLockedDungeons(Player* plr) { uint64 guid = plr->GetGUID(); - LfgLockMap cachedLockMap = GetLockedDungeons(guid); - if (!cachedLockMap.empty()) - return; - uint8 level = plr->getLevel(); uint8 expansion = plr->GetSession()->Expansion(); LfgDungeonSet dungeons = GetDungeonsByRandom(0); diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp index bedf2e7c43..49a14ff889 100644 --- a/src/server/game/DungeonFinding/LFGScripts.cpp +++ b/src/server/game/DungeonFinding/LFGScripts.cpp @@ -141,9 +141,9 @@ void LFGScripts::OnInviteMember(Group* group, uint64 guid) sLFGMgr->Leave(NULL, group); } -void LFGScripts::OnLevelChanged(Player* /*player*/, uint8 /*newLevel*/) +void LFGScripts::OnLevelChanged(Player* player, uint8 /*newLevel*/) { - // TODO - Invalidate LockStatus from cache + sLFGMgr->InitializeLockedDungeons(player); } void LFGScripts::OnLogout(Player* player) @@ -163,3 +163,10 @@ void LFGScripts::OnLogin(Player* player) sLFGMgr->InitializeLockedDungeons(player); // TODO - Restore LfgPlayerData and send proper status to player if it was in a group } + +void LFGScripts::OnBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool permanent) +{ + MapEntry const* mapEntry = sMapStore.LookupEntry(mapId); + if (mapEntry->IsDungeon() && difficulty > DUNGEON_DIFFICULTY_NORMAL) + sLFGMgr->InitializeLockedDungeons(player); +} \ No newline at end of file diff --git a/src/server/game/DungeonFinding/LFGScripts.h b/src/server/game/DungeonFinding/LFGScripts.h index 0c48affc34..d506a6be13 100644 --- a/src/server/game/DungeonFinding/LFGScripts.h +++ b/src/server/game/DungeonFinding/LFGScripts.h @@ -42,4 +42,5 @@ class LFGScripts: public GroupScript, public PlayerScript void OnLevelChanged(Player* player, uint8 newLevel); void OnLogout(Player* player); void OnLogin(Player* player); + void OnBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool permanent); };