Core/RBAC: Add permission that prevents getting a battleground deserter debuff.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
--
|
||||
DELETE FROM `rbac_permissions` WHERE `id` = 52;
|
||||
INSERT INTO `rbac_permissions` (`id`, `name`) VALUES (52, "No battleground deserter debuff");
|
||||
|
||||
DELETE FROM `rbac_linked_permissions` WHERE `linkedId` = 52;
|
||||
INSERT INTO `rbac_linked_permissions` (`id`, `linkedId`) VALUES
|
||||
(193, 52);
|
||||
@@ -102,6 +102,7 @@ enum RBACPermissions
|
||||
RBAC_PERM_EMAIL_CONFIRM_FOR_PASS_CHANGE = 49,
|
||||
RBAC_PERM_MAY_CHECK_OWN_EMAIL = 50,
|
||||
RBAC_PERM_ALLOW_TWO_SIDE_TRADE = 51,
|
||||
RBAC_PERM_NO_BATTLEGROUND_DESERTER_DEBUFF = 52,
|
||||
|
||||
// Free space for core permissions (till 149)
|
||||
// Roles (Permissions with delegated permissions) use 199 and descending
|
||||
|
||||
@@ -25306,14 +25306,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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user