From 41ac4d5822ba9daecfbb39639b86e16c748755de Mon Sep 17 00:00:00 2001 From: joschiwald Date: Fri, 14 Nov 2014 23:53:22 +0100 Subject: Script/Spells: fixed crash in spell_hun_aspect_of_the_beast Closes #13560 --- src/server/scripts/Spells/spell_hunter.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 22968d70ff1..6717bec109f 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -69,7 +69,7 @@ class spell_hun_aspect_of_the_beast : public SpellScriptLoader bool Load() override { - return GetCaster()->GetTypeId() == TYPEID_PLAYER; + return GetOwner()->GetTypeId() == TYPEID_PLAYER; } bool Validate(SpellInfo const* /*spellInfo*/) override @@ -81,16 +81,16 @@ class spell_hun_aspect_of_the_beast : public SpellScriptLoader void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (Player* caster = GetCaster()->ToPlayer()) - if (Pet* pet = caster->GetPet()) - pet->RemoveAurasDueToSpell(SPELL_HUNTER_ASPECT_OF_THE_BEAST_PET); + Player* player = GetTarget()->ToPlayer(); + if (Pet* pet = player->GetPet()) + pet->RemoveAurasDueToSpell(SPELL_HUNTER_ASPECT_OF_THE_BEAST_PET); } void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (Player* caster = GetCaster()->ToPlayer()) - if (caster->GetPet()) - caster->CastSpell(caster, SPELL_HUNTER_ASPECT_OF_THE_BEAST_PET, true); + Player* player = GetTarget()->ToPlayer(); + if (player->GetPet()) + player->CastSpell(player, SPELL_HUNTER_ASPECT_OF_THE_BEAST_PET, true); } void Register() override -- cgit v1.2.3