Core/Battlegrounds: Fixes Report AFK players and then leaving if "Inactive" buff expires

This commit is contained in:
Lopin
2011-05-11 12:14:00 +03:00
committed by Shocker
parent dc3ff5e5f2
commit 193f0b7cd3
2 changed files with 12 additions and 2 deletions
+3 -2
View File
@@ -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;