aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellAuras.cpp
diff options
context:
space:
mode:
authorkrz <none@none>2009-05-24 16:18:19 +0200
committerkrz <none@none>2009-05-24 16:18:19 +0200
commit4423ac319404dd52492e8ed0b56433046fb7fd9e (patch)
tree6586d0df15f6d03e60cc1c3e52cc1c8b1aeb2dba /src/game/SpellAuras.cpp
parentdd9d6ecad8c82f620c9321cd5cf39018acbc86fa (diff)
Range calculation fix.
Channeled SPELL_AURA_PERIODIC_TRIGGER_SPELL will now not trigger spell if target is out of range. Channeled periodic damage auras will now not deal damage if target is out of range. --HG-- branch : trunk
Diffstat (limited to 'src/game/SpellAuras.cpp')
-rw-r--r--src/game/SpellAuras.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 64e8887fd15..b3ee5acbe3b 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -543,7 +543,11 @@ void Aura::Update(uint32 diff)
}
// Channeled aura required check distance from caster except in possessed cases
- if(IsChanneledSpell(m_spellProto) && m_caster_guid != m_target->GetGUID() && !m_target->isPossessed())
+ Unit *pRealTarget = (GetSpellProto()->EffectApplyAuraName[GetEffIndex()] == SPELL_AURA_PERIODIC_TRIGGER_SPELL) ? GetTriggerTarget() : m_target;
+ if(!pRealTarget)
+ return;
+
+ if(IsChanneledSpell(m_spellProto) && !pRealTarget->isPossessed() && pRealTarget->GetGUID() != GetCasterGUID())
{
Unit* caster = GetCaster();
if(!caster)
@@ -569,11 +573,8 @@ void Aura::Update(uint32 diff)
if(Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(GetId(), mod, radius,NULL);
- if(!caster->IsWithinDistInMap(m_target,radius))
- {
- m_target->RemoveAura(GetId(),GetEffIndex());
+ if(!caster->IsWithinDistInMap(pRealTarget, radius))
return;
- }
}
if(m_isPeriodic && (m_duration >= 0 || m_isPassive || m_permanent))