diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-01-02 14:19:35 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-10-04 00:19:38 +0200 |
commit | 9b924522d0549dd67b10e2cbdfc20297dd21e182 (patch) | |
tree | f0fcdf96902b7c497c1bc65db83621a8dfadf43a /src/server/game/DungeonFinding/LFGMgr.cpp | |
parent | a131542855d23022714a97640be1c8d68a741c31 (diff) |
Core/Instances: Delete InstanceSaveMgr and replace most of its uses with new InstanceLockMgr
Diffstat (limited to 'src/server/game/DungeonFinding/LFGMgr.cpp')
-rw-r--r-- | src/server/game/DungeonFinding/LFGMgr.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index a586f723edb..69972a4643e 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -23,7 +23,7 @@ #include "GameTime.h" #include "Group.h" #include "GroupMgr.h" -#include "InstanceSaveMgr.h" +#include "InstanceLockMgr.h" #include "LFGGroupData.h" #include "LFGPlayerData.h" #include "LFGQueue.h" @@ -841,17 +841,15 @@ void LFGMgr::GetCompatibleDungeons(LfgDungeonSet* dungeons, GuidSet const& playe LFGDungeonData const* dungeon = GetLFGDungeon(dungeonId); ASSERT(dungeon); ASSERT(player); - if (InstancePlayerBind* playerBind = player->GetBoundInstance(dungeon->map, Difficulty(dungeon->difficulty))) + MapDb2Entries entries{ dungeon->map, Difficulty(dungeon->difficulty) }; + if (InstanceLock* playerBind = sInstanceLockMgr.FindActiveInstanceLock(guid, entries)) { - if (InstanceSave* playerSave = playerBind->save) - { - uint32 dungeonInstanceId = playerSave->GetInstanceId(); - auto itLockedDungeon = lockedDungeons.find(dungeonId); - if (itLockedDungeon == lockedDungeons.end() || itLockedDungeon->second == dungeonInstanceId) - eraseDungeon = false; - - lockedDungeons[dungeonId] = dungeonInstanceId; - } + uint32 dungeonInstanceId = playerBind->GetInstanceId(); + auto itLockedDungeon = lockedDungeons.find(dungeonId); + if (itLockedDungeon == lockedDungeons.end() || itLockedDungeon->second == dungeonInstanceId) + eraseDungeon = false; + + lockedDungeons[dungeonId] = dungeonInstanceId; } } @@ -1733,7 +1731,7 @@ LfgLockMap LFGMgr::GetLockedDungeons(ObjectGuid guid) return LFG_LOCKSTATUS_NOT_IN_SEASON; if (DisableMgr::IsDisabledFor(DISABLE_TYPE_LFG_MAP, dungeon->map, player)) return LFG_LOCKSTATUS_RAID_LOCKED; - if (dungeon->difficulty > DIFFICULTY_NORMAL && player->GetBoundInstance(dungeon->map, Difficulty(dungeon->difficulty))) + if (dungeon->difficulty > DIFFICULTY_NORMAL && sInstanceLockMgr.FindActiveInstanceLock(guid, { dungeon->map, Difficulty(dungeon->difficulty) })) return LFG_LOCKSTATUS_RAID_LOCKED; if (Optional<ContentTuningLevels> levels = sDB2Manager.GetContentTuningData(dungeon->contentTuningId, player->m_playerData->CtrOptions->ContentTuningConditionMask)) { |