[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; WorldObject* target = NULL;
// select first not resisted target from target list for _0_ effect // 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) 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); target = ObjectAccessor::GetUnit(*m_caster, itr->targetGUID);
break; 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) 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); target = m_caster->GetMap()->GetGameObject(itr->targetGUID);
break; break;
@ -3825,7 +3826,7 @@ void Spell::SendChannelStart(uint32 duration)
m_timer = duration; m_timer = duration;
if(target) if (target)
m_caster->SetChannelObjectGUID(target->GetGUID()); m_caster->SetChannelObjectGUID(target->GetGUID());
m_caster->SetUInt32Value(UNIT_CHANNEL_SPELL, m_spellInfo->Id); m_caster->SetUInt32Value(UNIT_CHANNEL_SPELL, m_spellInfo->Id);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "10191" #define REVISION_NR "10192"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__