Core/ObjectMgr: Remove GetPlayer function (Remove double use of singletons)

This commit is contained in:
Spp-
2011-07-27 12:14:27 +02:00
parent fa50c0a464
commit b2a84d9f1e
47 changed files with 166 additions and 168 deletions
@@ -142,20 +142,20 @@ void BattlegroundWS::Update(uint32 diff)
m_FlagSpellForceTimer += diff;
if (m_FlagDebuffState == 0 && m_FlagSpellForceTimer >= 600000) //10 minutes
{
if (Player* plr = sObjectMgr->GetPlayer(m_FlagKeepers[0]))
if (Player* plr = ObjectAccessor::FindPlayer(m_FlagKeepers[0]))
plr->CastSpell(plr, WS_SPELL_FOCUSED_ASSAULT, true);
if (Player* plr = sObjectMgr->GetPlayer(m_FlagKeepers[1]))
if (Player* plr = ObjectAccessor::FindPlayer(m_FlagKeepers[1]))
plr->CastSpell(plr, WS_SPELL_FOCUSED_ASSAULT, true);
m_FlagDebuffState = 1;
}
else if (m_FlagDebuffState == 1 && m_FlagSpellForceTimer >= 900000) //15 minutes
{
if (Player* plr = sObjectMgr->GetPlayer(m_FlagKeepers[0]))
if (Player* plr = ObjectAccessor::FindPlayer(m_FlagKeepers[0]))
{
plr->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
plr->CastSpell(plr, WS_SPELL_BRUTAL_ASSAULT, true);
}
if (Player* plr = sObjectMgr->GetPlayer(m_FlagKeepers[1]))
if (Player* plr = ObjectAccessor::FindPlayer(m_FlagKeepers[1]))
{
plr->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
plr->CastSpell(plr, WS_SPELL_BRUTAL_ASSAULT, true);