From 65e675ee0f93c3f629a8cc96e836e5847f3d2022 Mon Sep 17 00:00:00 2001 From: Den Date: Wed, 25 Apr 2012 23:12:13 +0200 Subject: [PATCH] [11981] Fix targeting of most pet spells. They expect to target alive pets Signed-off-by: Schmoozerd --- src/game/Spell.cpp | 11 +++++++---- src/shared/revision_nr.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index a389f3c283d..822965adc98 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -4920,17 +4920,20 @@ SpellCastResult Spell::CheckCast(bool strict) } // check pet presents - for(int j = 0; j < MAX_EFFECT_INDEX; ++j) + for (int j = 0; j < MAX_EFFECT_INDEX; ++j) { - if(m_spellInfo->EffectImplicitTargetA[j] == TARGET_PET) + if (m_spellInfo->EffectImplicitTargetA[j] == TARGET_PET) { - if(!m_caster->GetPet()) + Pet* pet = m_caster->GetPet(); + if (!pet) { - if(m_triggeredByAuraSpell) // not report pet not existence for triggered spells + if (m_triggeredByAuraSpell) // not report pet not existence for triggered spells return SPELL_FAILED_DONT_REPORT; else return SPELL_FAILED_NO_PET; } + else if (!pet->isAlive()) + return SPELL_FAILED_TARGETS_DEAD; break; } } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index c3a676523f4..d54444a3641 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11980" + #define REVISION_NR "11981" #endif // __REVISION_NR_H__