refactore(core/config): Move BG Report AFK To Conf (#2813)

This commit is contained in:
IntelligentQuantum
2020-07-10 22:36:12 +04:30
committed by GitHub
parent a0b00be5b0
commit ec806d6c60
4 changed files with 32 additions and 5 deletions

View File

@@ -22761,15 +22761,15 @@ void Player::ReportedAfkBy(Player* reporter)
return;
// Xinef: 2 minutes startup + 2 minute of match
if (bg->GetStartTime() < 4*MINUTE*IN_MILLISECONDS)
if (bg->GetStartTime() < sWorld->getIntConfig(CONFIG_BATTLEGROUND_REPORT_AFK_TIMER) * MINUTE * IN_MILLISECONDS)
return;
// check if player has 'Idle' or 'Inactive' debuff
if (m_bgData.bgAfkReporter.find(reporter->GetGUIDLow()) == m_bgData.bgAfkReporter.end() && !HasAura(43680) && !HasAura(43681) && reporter->CanReportAfkDueToLimit())
{
m_bgData.bgAfkReporter.insert(reporter->GetGUIDLow());
// 3 players have to complain to apply debuff
if (m_bgData.bgAfkReporter.size() >= 3)
// by default 3 players have to complain to apply debuff
if (m_bgData.bgAfkReporter.size() >= sWorld->getIntConfig(CONFIG_BATTLEGROUND_REPORT_AFK))
{
// cast 'Idle' spell
CastSpell(this, 43680, true);