Core/Battlegrounds: Fixes Report AFK players and then leaving if "Inactive" buff expires
This commit is contained in:
@@ -20854,8 +20854,9 @@ bool Player::CanReportAfkDueToLimit()
|
||||
///This player has been blamed to be inactive in a battleground
|
||||
void Player::ReportedAfkBy(Player* reporter)
|
||||
{
|
||||
Battleground *bg = GetBattleground();
|
||||
if (!bg || bg != reporter->GetBattleground() || GetTeam() != reporter->GetTeam())
|
||||
Battleground* bg = GetBattleground();
|
||||
// Battleground also must be in progress!
|
||||
if (!bg || bg != reporter->GetBattleground() || GetTeam() != reporter->GetTeam() || bg->GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
// check if player has 'Idle' or 'Inactive' debuff
|
||||
|
||||
@@ -5927,6 +5927,15 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 43681: // Inactive
|
||||
{
|
||||
if (!target || target->GetTypeId() != TYPEID_PLAYER || aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
|
||||
return;
|
||||
|
||||
if (target->GetMap()->IsBattleground())
|
||||
target->ToPlayer()->LeaveBattleground();
|
||||
break;
|
||||
}
|
||||
case 42783: // Wrath of the Astromancer
|
||||
target->CastSpell(target, GetAmount(), true, NULL, this);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user