diff options
| author | Andrew <47818697+Nyeriah@users.noreply.github.com> | 2025-12-10 10:40:34 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-10 10:40:34 -0300 |
| commit | d1ff286c0d7451fb5d9dfae17bf6e0ebb50b407c (patch) | |
| tree | 6796f1abf43119bdaa9cf43be63e3a5378be3730 /src/server/game/Conditions/DisableMgr.cpp | |
| parent | b73028f6f540d922ae8a784a819ad14acea2b466 (diff) | |
fix(Core/LFG): Don't include disabled maps in the LFG queue (#24057)
Diffstat (limited to 'src/server/game/Conditions/DisableMgr.cpp')
| -rw-r--r-- | src/server/game/Conditions/DisableMgr.cpp | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp index 234ddfe5a2..c02c7c6819 100644 --- a/src/server/game/Conditions/DisableMgr.cpp +++ b/src/server/game/Conditions/DisableMgr.cpp @@ -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: |
