diff options
author | Ovahlord <dreadkiller@gmx.de> | 2020-07-07 13:56:16 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-01-21 22:09:06 +0100 |
commit | 7a5529eb58daad9216416c9c632543b1a931ce1f (patch) | |
tree | 57b17d1da4ef153cf33574c9f9110108a86117c5 /src/server/game/Battlegrounds/BattlegroundMgr.cpp | |
parent | 92e77e456a86900a673c927053c739ce4d0f4bc3 (diff) |
Core/Events: refactored battleground holiday assignments.
Instead of going with shitty bitmasks we now accept plain battleground ids
instead
(cherry picked from commit 8a82403400ef49415e14530f4b55d55ef38bc74e)
Diffstat (limited to 'src/server/game/Battlegrounds/BattlegroundMgr.cpp')
-rw-r--r-- | src/server/game/Battlegrounds/BattlegroundMgr.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 7cca34a4246..4447665b892 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -620,12 +620,17 @@ void BattlegroundMgr::ToggleArenaTesting() sWorld->SendWorldText(m_ArenaTesting ? LANG_DEBUG_ARENA_ON : LANG_DEBUG_ARENA_OFF); } -void BattlegroundMgr::SetHolidayWeekends(uint32 mask) +void BattlegroundMgr::ResetHolidays() { - // The current code supports battlegrounds up to BattlegroundTypeId(31) - for (uint32 bgtype = 1; bgtype < MAX_BATTLEGROUND_TYPE_ID && bgtype < 32; ++bgtype) - if (Battleground* bg = GetBattlegroundTemplate(BattlegroundTypeId(bgtype))) - bg->SetHoliday((mask & (1 << bgtype)) != 0); + for (uint32 i = BATTLEGROUND_AV; i < MAX_BATTLEGROUND_TYPE_ID; i++) + if (Battleground* bg = GetBattlegroundTemplate(BattlegroundTypeId(i))) + bg->SetHoliday(false); +} + +void BattlegroundMgr::SetHolidayActive(uint32 battlegroundId) +{ + if (Battleground* bg = GetBattlegroundTemplate(BattlegroundTypeId(battlegroundId))) + bg->SetHoliday(true); } bool BattlegroundMgr::IsValidQueueId(BattlegroundQueueTypeId bgQueueTypeId) |