Core/Dungeon Finder: Reset player Locked Dungeons after change level or bind to heroic instance
Note: Actual DF system is not supposed to select a dungeon you are already saved to (core does not support someone to have multiple saves on the same instance) --HG-- branch : trunk
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user