fix(Core/LFG): Don't include disabled maps in the LFG queue (#24057)

This commit is contained in:
Andrew
2025-12-10 10:40:34 -03:00
committed by GitHub
parent b73028f6f5
commit d1ff286c0d
4 changed files with 56 additions and 27 deletions

View File

@@ -388,30 +388,39 @@ bool DisableMgr::IsDisabledFor(DisableType type, uint32 entry, Unit const* unit,
}
case DISABLE_TYPE_MAP:
case DISABLE_TYPE_LFG_MAP:
if (Player const* player = unit->ToPlayer())
{
MapEntry const* mapEntry = sMapStore.LookupEntry(entry);
if (!mapEntry)
return false;
if (!mapEntry->IsDungeon())
return mapEntry->map_type == MAP_COMMON;
uint8 disabledModes = itr->second.flags;
Difficulty targetDifficulty;
if (unit && unit->IsPlayer())
targetDifficulty = unit->ToPlayer()->GetDifficulty(mapEntry->IsRaid());
else
targetDifficulty = Difficulty(flags);
GetDownscaledMapDifficultyData(entry, targetDifficulty);
switch (targetDifficulty)
{
MapEntry const* mapEntry = sMapStore.LookupEntry(entry);
if (mapEntry->IsDungeon())
{
uint8 disabledModes = itr->second.flags;
Difficulty targetDifficulty = player->GetDifficulty(mapEntry->IsRaid());
GetDownscaledMapDifficultyData(entry, targetDifficulty);
switch (targetDifficulty)
{
case DUNGEON_DIFFICULTY_NORMAL:
return disabledModes & DUNGEON_STATUSFLAG_NORMAL;
case DUNGEON_DIFFICULTY_HEROIC:
return disabledModes & DUNGEON_STATUSFLAG_HEROIC;
case RAID_DIFFICULTY_10MAN_HEROIC:
return disabledModes & RAID_STATUSFLAG_10MAN_HEROIC;
case RAID_DIFFICULTY_25MAN_HEROIC:
return disabledModes & RAID_STATUSFLAG_25MAN_HEROIC;
}
}
else if (mapEntry->map_type == MAP_COMMON)
return true;
case DUNGEON_DIFFICULTY_NORMAL:
return disabledModes & DUNGEON_STATUSFLAG_NORMAL;
case DUNGEON_DIFFICULTY_HEROIC:
return disabledModes & DUNGEON_STATUSFLAG_HEROIC;
case RAID_DIFFICULTY_10MAN_HEROIC:
return disabledModes & RAID_STATUSFLAG_10MAN_HEROIC;
case RAID_DIFFICULTY_25MAN_HEROIC:
return disabledModes & RAID_STATUSFLAG_25MAN_HEROIC;
default:
return false;
}
return false;
}
case DISABLE_TYPE_VMAP:
return flags & itr->second.flags;
case DISABLE_TYPE_QUEST: