Battleground/Arena: Properly check RBAC arena join permission before allowing queue.

Port From (https://github.com/TrinityCore/TrinityCore/commit/a69a061d76fe4e142e84c775230e2fcbd6ddb9d4)
This commit is contained in:
hondacrx
2021-12-27 17:06:18 -05:00
parent cba0f64c2d
commit c209f30475
3 changed files with 31 additions and 17 deletions
+8 -13
View File
@@ -751,22 +751,17 @@ namespace Game.Entities
}
}
public bool IsDeserter() { return HasAura(26013); }
public bool CanJoinToBattleground(Battleground bg)
{
// check Deserter debuff
if (HasAura(26013))
return false;
RBACPermissions perm = RBACPermissions.JoinNormalBg;
if (bg.IsArena())
perm = RBACPermissions.JoinArenas;
else if (bg.IsRandom())
perm = RBACPermissions.JoinRandomBg;
if (bg.IsArena() && !GetSession().HasPermission(RBACPermissions.JoinArenas))
return false;
if (bg.IsRandom() && !GetSession().HasPermission(RBACPermissions.JoinRandomBg))
return false;
if (!GetSession().HasPermission(RBACPermissions.JoinNormalBg))
return false;
return true;
return GetSession().HasPermission(perm);
}
public void ClearAfkReports() { m_bgData.bgAfkReporter.Clear(); }