diff options
| author | Carbenium <carbenium@outlook.com> | 2020-08-01 22:40:10 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-01-26 14:37:05 +0100 |
| commit | c302ace1004119ad361271479fe4547485996e8f (patch) | |
| tree | 58a8a75de93ed9ab2851a78920f125a6b2c1389c /src | |
| parent | fa8ab6eb98395ed468046c261fe120082d4e019b (diff) | |
Scripts/AzjolNerub: Fix potential error in pound spell script
Cast damage spell in AfterEffectApply instead OnEffectHitTarget. This avoids the scenario where we try to apply an aura to a potential dead target.
Ref #21856
(cherry picked from commit 0dd4b685df53d9b61a53aaf3a577c2a9ed8cdd47)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp index 9be552892da..6f831619168 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp @@ -600,24 +600,24 @@ struct npc_anubarak_impale_target : public NullCreatureAI } }; -class spell_anubarak_pound : public SpellScript +class spell_anubarak_pound : public AuraScript { - PrepareSpellScript(spell_anubarak_pound); + PrepareAuraScript(spell_anubarak_pound); bool Validate(SpellInfo const* /*spell*/) override { return ValidateSpellInfo({ SPELL_POUND_DAMAGE }); } - void HandleDummy(SpellEffIndex /*effIndex*/) + void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (Unit* target = GetHitUnit()) + if (Unit* target = GetTarget()) GetCaster()->CastSpell(target, SPELL_POUND_DAMAGE, true); } void Register() override { - OnEffectHitTarget += SpellEffectFn(spell_anubarak_pound::HandleDummy, EFFECT_0, SPELL_EFFECT_APPLY_AURA); + AfterEffectApply += AuraEffectApplyFn(spell_anubarak_pound::AfterApply, EFFECT_2, SPELL_AURA_FLY, AURA_EFFECT_HANDLE_REAL); } }; @@ -652,6 +652,6 @@ void AddSC_boss_anub_arak() RegisterCreatureAIWithFactory(npc_anubarak_anub_ar_venomancer, GetAzjolNerubAI); RegisterCreatureAIWithFactory(npc_anubarak_impale_target, GetAzjolNerubAI); - RegisterSpellScript(spell_anubarak_pound); + RegisterAuraScript(spell_anubarak_pound); RegisterAuraScript(spell_anubarak_carrion_beetles); } |
