Core/RBAC: Add permission that prevents getting a battleground deserter debuff.

(cherry picked from commit 196dd226dfb0ffe80d4db8531d8d337fba3d2003)
This commit is contained in:
r4dish
2026-05-26 23:08:27 +02:00
committed by Shauren
parent c1e0125f10
commit 40348c62d3
4 changed files with 23 additions and 8 deletions
+10 -6
View File
@@ -24392,14 +24392,18 @@ Team Player::GetBGTeam() const
return m_bgData.bgTeam ? m_bgData.bgTeam : GetTeam();
}
void Player::LeaveBattleground(bool teleportToEntryPoint)
void Player::LeaveBattleground(bool teleportToEntryPoint /*= true*/)
{
if (Battleground* bg = GetBattleground())
{
bg->RemovePlayerAtLeave(GetGUID(), teleportToEntryPoint, true);
Battleground* bg = GetBattleground();
if (!bg)
return;
// call after remove to be sure that player resurrected for correct cast
if (bg->isBattleground() && !IsGameMaster() && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_CAST_DESERTER))
bg->RemovePlayerAtLeave(GetGUID(), teleportToEntryPoint, true);
// call after remove to be sure that player resurrected for correct cast
if (bg->isBattleground() && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_CAST_DESERTER))
{
if (!GetSession()->HasPermission(rbac::RBAC_PERM_NO_BATTLEGROUND_DESERTER_DEBUFF))
{
if (bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN)
{