From 634e41fc1ca0b803253076b904a0bb13385bb41c Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Fri, 4 Feb 2022 11:27:20 -0300 Subject: [PATCH] =?UTF-8?q?fix(Core/Spells):=20delete=20creatures=20threat?= =?UTF-8?q?=20list=20after=20taming=20them=20for=20t=E2=80=A6=20(#10224)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/scripts/Spells/spell_hunter.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 6560329e3..961528844 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -277,6 +277,17 @@ class spell_hun_taming_the_beast : public AuraScript { PrepareAuraScript(spell_hun_taming_the_beast); + void HandleOnEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* target = GetTarget()) + { + if (Creature* creature = target->ToCreature()) + { + creature->DeleteThreatList(); + } + } + } + void HandleOnEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Unit* target = GetTarget()) @@ -286,6 +297,7 @@ class spell_hun_taming_the_beast : public AuraScript void Register() override { + OnEffectApply += AuraEffectApplyFn(spell_hun_taming_the_beast::HandleOnEffectApply, EFFECT_0, SPELL_AURA_MOD_CHARM, AURA_EFFECT_HANDLE_REAL); OnEffectRemove += AuraEffectRemoveFn(spell_hun_taming_the_beast::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_MOD_CHARM, AURA_EFFECT_HANDLE_REAL); } };