[11981] Fix targeting of most pet spells. They expect to target alive pets

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
Den 2012-04-25 23:12:13 +02:00 committed by Schmoozerd
parent d08edbd93c
commit 67fe27774c
2 changed files with 8 additions and 5 deletions

View file

@ -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;
}
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11980"
#define REVISION_NR "11981"
#endif // __REVISION_NR_H__