From f3d0021ce882a5fb3977bef53f3659823ac6f083 Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 27 Dec 2008 15:28:30 -0600 Subject: *Fix the bug that spirit of redemption can be killed. --HG-- branch : trunk --- src/game/Spell.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/game/Spell.cpp') diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 7aeb0159e9d..15259bf1af0 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1111,6 +1111,14 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) if( m_caster != unit ) { + if (unit->GetCharmerOrOwnerGUID() != m_caster->GetGUID()) + { + if (unit->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + { + m_caster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_EVADE); + return; + } + } if( !m_caster->IsFriendlyTo(unit) ) { // for delayed spells ignore not visible explicit target -- cgit v1.2.3 From f286c83d1525ee70ea60e8cffb1c8e3433a8dca2 Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 27 Dec 2008 16:37:55 -0600 Subject: *Fix a bug that Prayer of Shadow Protection cannot be casted on other party. --HG-- branch : trunk --- src/game/Spell.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/game/Spell.cpp') diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 15259bf1af0..52aa86bcf24 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1518,10 +1518,10 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list &TagUnitMap) case TARGET_UNIT_TARGET_ANY: // SelectMagnetTarget()? case TARGET_UNIT_TARGET_PARTY: case TARGET_UNIT_SINGLE_UNKNOWN: - TagUnitMap.push_back(m_targets.getUnitTarget()); + TagUnitMap.push_back(target); break; case TARGET_UNIT_PARTY_TARGET: - m_caster->GetPartyMember(TagUnitMap, radius); + target->GetPartyMember(TagUnitMap, radius); break; case TARGET_UNIT_TARGET_ENEMY: if(Unit* pUnitTarget = SelectMagnetTarget()) -- cgit v1.2.3 From 1a53ea2c02ed0fd865798e2c3b97b2871944d971 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 28 Dec 2008 09:25:29 -0600 Subject: *Remove auras by caster when interrupt channelled spells. --HG-- branch : trunk --- src/game/Spell.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/game/Spell.cpp') diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 52aa86bcf24..c17e5632cb9 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2130,11 +2130,11 @@ void Spell::cancel() { Unit* unit = m_caster->GetGUID()==(*ihit).targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, ihit->targetGUID); if( unit && unit->isAlive() ) - unit->RemoveAurasDueToSpell(m_spellInfo->Id); + unit->RemoveAurasDueToCasterSpell(m_spellInfo->Id, m_caster->GetGUID()); } } - m_caster->RemoveAurasDueToSpell(m_spellInfo->Id); + m_caster->RemoveAurasDueToCasterSpell(m_spellInfo->Id, m_caster->GetGUID()); SendChannelUpdate(0); SendInterrupted(0); SendCastResult(SPELL_FAILED_INTERRUPTED); -- cgit v1.2.3