mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 08:06:23 +00:00
fix(Core/LFG): Don't include disabled maps in the LFG queue (#24057)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user