[10192] Small cleanups related target effectMask check.

This commit is contained in:
VladimirMangos 2010-07-15 02:44:01 +04:00
parent ebe28d025b
commit f4dde39085
2 changed files with 6 additions and 5 deletions

View file

@ -3794,11 +3794,12 @@ void Spell::SendChannelStart(uint32 duration)
WorldObject* target = NULL;
// select first not resisted target from target list for _0_ effect
if(!m_UniqueTargetInfo.empty())
if (!m_UniqueTargetInfo.empty())
{
for(std::list<TargetInfo>::const_iterator itr = m_UniqueTargetInfo.begin(); itr != m_UniqueTargetInfo.end(); ++itr)
{
if( (itr->effectMask & (1 << 0)) && itr->reflectResult == SPELL_MISS_NONE && itr->targetGUID != m_caster->GetObjectGuid())
if ((itr->effectMask & (1 << EFFECT_INDEX_0)) && itr->reflectResult == SPELL_MISS_NONE &&
itr->targetGUID != m_caster->GetObjectGuid())
{
target = ObjectAccessor::GetUnit(*m_caster, itr->targetGUID);
break;
@ -3809,7 +3810,7 @@ void Spell::SendChannelStart(uint32 duration)
{
for(std::list<GOTargetInfo>::const_iterator itr = m_UniqueGOTargetInfo.begin(); itr != m_UniqueGOTargetInfo.end(); ++itr)
{
if(itr->effectMask & (1 << 0) )
if (itr->effectMask & (1 << EFFECT_INDEX_0))
{
target = m_caster->GetMap()->GetGameObject(itr->targetGUID);
break;
@ -3825,7 +3826,7 @@ void Spell::SendChannelStart(uint32 duration)
m_timer = duration;
if(target)
if (target)
m_caster->SetChannelObjectGUID(target->GetGUID());
m_caster->SetUInt32Value(UNIT_CHANNEL_SPELL, m_spellInfo->Id);