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
+2 -1
View File
@@ -20855,7 +20855,8 @@ bool Player::CanReportAfkDueToLimit()
void Player::ReportedAfkBy(Player* reporter) void Player::ReportedAfkBy(Player* reporter)
{ {
Battleground* bg = GetBattleground(); Battleground* bg = GetBattleground();
if (!bg || bg != reporter->GetBattleground() || GetTeam() != reporter->GetTeam()) // Battleground also must be in progress!
if (!bg || bg != reporter->GetBattleground() || GetTeam() != reporter->GetTeam() || bg->GetStatus() != STATUS_IN_PROGRESS)
return; return;
// check if player has 'Idle' or 'Inactive' debuff // check if player has 'Idle' or 'Inactive' debuff
@@ -5927,6 +5927,15 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo
} }
break; 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 case 42783: // Wrath of the Astromancer
target->CastSpell(target, GetAmount(), true, NULL, this); target->CastSpell(target, GetAmount(), true, NULL, this);
break; break;