Core/Battleground: Check battlegrounds disabled in db2 files
Port From (https://github.com/TrinityCore/TrinityCore/commit/5d57415951c4b6f7b86c97922c94b571a178f35a)
This commit is contained in:
@@ -64,19 +64,19 @@ namespace Game
|
||||
return;
|
||||
}
|
||||
|
||||
uint bgTypeId_ = (uint)(battlemasterJoin.QueueIDs[0] & 0xFFFF);
|
||||
if (!CliDB.BattlemasterListStorage.ContainsKey(bgTypeId_))
|
||||
BattlegroundTypeId bgTypeId = (BattlegroundTypeId)(battlemasterJoin.QueueIDs[0] & 0xFFFF);
|
||||
BattlemasterListRecord battlemasterListEntry = CliDB.BattlemasterListStorage.LookupByKey(bgTypeId);
|
||||
if (battlemasterListEntry == null)
|
||||
{
|
||||
Log.outError(LogFilter.Network, "Battleground: invalid bgtype ({0}) received. possible cheater? player guid {1}", bgTypeId_, GetPlayer().GetGUID().ToString());
|
||||
Log.outError(LogFilter.Network, "Battleground: invalid bgtype ({0}) received. possible cheater? player guid {1}", bgTypeId, GetPlayer().GetGUID().ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
if (Global.DisableMgr.IsDisabledFor(DisableType.Battleground, bgTypeId_, null))
|
||||
if (Global.DisableMgr.IsDisabledFor(DisableType.Battleground, (uint)bgTypeId, null) || battlemasterListEntry.Flags.HasAnyFlag(BattlemasterListFlags.Disabled))
|
||||
{
|
||||
GetPlayer().SendSysMessage(CypherStrings.BgDisabled);
|
||||
return;
|
||||
}
|
||||
BattlegroundTypeId bgTypeId = (BattlegroundTypeId)bgTypeId_;
|
||||
|
||||
// can do this, since it's Battleground, not arena
|
||||
BattlegroundQueueTypeId bgQueueTypeId = Global.BattlegroundMgr.BGQueueTypeId(bgTypeId, 0);
|
||||
|
||||
Reference in New Issue
Block a user