diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_warlock.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 9b227737e0a..a48661d4aed 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -683,25 +683,25 @@ public: class spell_warl_health_funnel_AuraScript : public AuraScript { PrepareAuraScript(spell_warl_health_funnel_AuraScript) + void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (Unit* target = GetTarget()) - { - if (GetCaster()->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R2)) - target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2, true); - else if (GetCaster()->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R1)) - target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1, true); - } - + Unit* caster = GetCaster(); + if (!caster) + return; + + Unit* target = GetTarget(); + if (caster->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R2)) + target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2, true); + else if (caster->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R1)) + target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1, true); } void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (Unit* target = GetTarget()) - { - target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1); - target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2); - } + Unit* target = GetTarget(); + target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1); + target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2); } void Register() |