Core/LFG: Add convenience function to get which random dungeon was selected by queued player

Port From (https://github.com/TrinityCore/TrinityCore/commit/84a0b5569552a9f5a6074d102135933b9a4a52f4)
This commit is contained in:
hondacrx
2019-11-18 10:05:15 -05:00
parent b768173b34
commit 23fa2a5dc9
2 changed files with 25 additions and 12 deletions
+16
View File
@@ -1486,6 +1486,22 @@ namespace Game.DungeonFinding
return PlayersStore[guid].GetSelectedDungeons();
}
public uint GetSelectedRandomDungeon(ObjectGuid guid)
{
if (GetState(guid) != LfgState.None)
{
var dungeons = GetSelectedDungeons(guid);
if (!dungeons.Empty())
{
LFGDungeonData dungeon = GetLFGDungeon(dungeons.First());
if (dungeon != null && dungeon.type == LfgType.Raid)
return dungeons.First();
}
}
return 0;
}
public Dictionary<uint, LfgLockInfoData> GetLockedDungeons(ObjectGuid guid)
{
Dictionary<uint, LfgLockInfoData> lockDic = new Dictionary<uint, LfgLockInfoData>();