update (core\store): sLFGDungeonStore update (#15325)

* update (core\store): sLFGDungeonStore update

update (core\store): sLFGDungeonStore update

Co-Authored-By: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

* update (core\store): sLFGDungeonStore update

Co-Authored-By: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

---------

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
M'Dic
2023-04-29 06:25:49 -04:00
committed by GitHub
parent 2e98e7c42a
commit e5665c32f8
8 changed files with 90 additions and 29 deletions

View File

@@ -847,9 +847,15 @@ CharStartOutfitEntry const* GetCharStartOutfitEntry(uint8 race, uint8 class_, ui
/// Returns LFGDungeonEntry for a specific map and difficulty. Will return first found entry if multiple dungeons use the same map (such as Scarlet Monastery)
LFGDungeonEntry const* GetLFGDungeon(uint32 mapId, Difficulty difficulty)
{
for (LFGDungeonEntry const* dungeon : sLFGDungeonStore)
if (dungeon->map == int32(mapId) && Difficulty(dungeon->difficulty) == difficulty)
for (uint32 i = 0; i < sLFGDungeonStore.GetNumRows(); ++i)
{
LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(i);
if (!dungeon)
continue;
if (dungeon->MapID == uint32(mapId) && Difficulty(dungeon->Difficulty) == difficulty)
return dungeon;
}
return nullptr;
}
@@ -858,7 +864,7 @@ LFGDungeonEntry const* GetZoneLFGDungeonEntry(std::string const& zoneName, Local
{
for (LFGDungeonEntry const* dungeon : sLFGDungeonStore)
{
if (dungeon->type == lfg::LFG_TYPE_ZONE && zoneName.find(dungeon->name[locale]) != std::string::npos)
if (dungeon->TypeID == lfg::LFG_TYPE_ZONE && zoneName.find(dungeon->Name[locale]) != std::string::npos)
{
return dungeon;
}