Core/Events: refactored battleground holiday assignments. Instead of going with shitty bitmasks we now accept plain battleground ids instead
Port From (https://github.com/TrinityCore/TrinityCore/commit/7a5529eb58daad9216416c9c632543b1a931ce1f)
This commit is contained in:
@@ -501,17 +501,23 @@ namespace Game.BattleGrounds
|
||||
Global.WorldMgr.SendWorldText(m_ArenaTesting ? CypherStrings.DebugArenaOn : CypherStrings.DebugArenaOff);
|
||||
}
|
||||
|
||||
public void SetHolidayWeekends(uint mask)
|
||||
public void ResetHolidays()
|
||||
{
|
||||
// The current code supports battlegrounds up to BattlegroundTypeId(31)
|
||||
for (var bgtype = 1; bgtype < (int)BattlegroundTypeId.Max && bgtype < 32; ++bgtype)
|
||||
for (var i = BattlegroundTypeId.AV; i < BattlegroundTypeId.Max; i++)
|
||||
{
|
||||
Battleground bg = GetBattlegroundTemplate((BattlegroundTypeId)bgtype);
|
||||
if (bg)
|
||||
bg.SetHoliday(Convert.ToBoolean(mask & (1 << bgtype)));
|
||||
Battleground bg = GetBattlegroundTemplate(i);
|
||||
if (bg != null)
|
||||
bg.SetHoliday(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetHolidayActive(uint battlegroundId)
|
||||
{
|
||||
Battleground bg = GetBattlegroundTemplate((BattlegroundTypeId)battlegroundId);
|
||||
if (bg != null)
|
||||
bg.SetHoliday(true);
|
||||
}
|
||||
|
||||
public bool IsValidQueueId(BattlegroundQueueTypeId bgQueueTypeId)
|
||||
{
|
||||
BattlemasterListRecord battlemasterList = CliDB.BattlemasterListStorage.LookupByKey(bgQueueTypeId.BattlemasterListId);
|
||||
|
||||
Reference in New Issue
Block a user