aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2018-02-10 16:43:01 -0300
committerShauren <shauren.trinity@gmail.com>2021-08-28 15:59:11 +0200
commit962f6d7988b9003e550f6745be7cff812e9d8efa (patch)
treeee6ab5872b947afb00f4ca99e87c7dddea35bdb3 /src/server/scripts/Spells
parent65dca120d34febdaa84a63e17f638ab0fa59b3df (diff)
Core/Spells: rework part 5: GameObject casting
Closes #21330 Closes #18885 Ref #18752 (cherry picked from commit 45c5e1b9d63796d168339a44f63418f220cf2403)
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_warlock.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
index f11802d79a5..737012cf41f 100644
--- a/src/server/scripts/Spells/spell_warlock.cpp
+++ b/src/server/scripts/Spells/spell_warlock.cpp
@@ -907,15 +907,17 @@ class spell_warl_unstable_affliction : public SpellScriptLoader
{
if (AuraEffect const* aurEff = GetEffect(EFFECT_1))
{
- Unit* target = dispelInfo->GetDispeller();
- int32 bp = aurEff->GetAmount();
- bp = target->SpellDamageBonusTaken(caster, aurEff->GetSpellInfo(), bp, DOT);
- bp *= 9;
-
- // backfire damage and silence
- CastSpellExtraArgs args(aurEff);
- args.AddSpellBP0(bp);
- caster->CastSpell(target, SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL, args);
+ if (Unit* target = dispelInfo->GetDispeller()->ToUnit())
+ {
+ int32 bp = aurEff->GetAmount();
+ bp = target->SpellDamageBonusTaken(caster, aurEff->GetSpellInfo(), bp, DOT);
+ bp *= 9;
+
+ // backfire damage and silence
+ CastSpellExtraArgs args(aurEff);
+ args.AddSpellBP0(bp);
+ caster->CastSpell(target, SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL, args);
+ }
}
}
}