mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[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:
parent
d08edbd93c
commit
67fe27774c
2 changed files with 8 additions and 5 deletions
|
|
@ -4920,17 +4920,20 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||||
}
|
}
|
||||||
|
|
||||||
// check pet presents
|
// 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;
|
return SPELL_FAILED_DONT_REPORT;
|
||||||
else
|
else
|
||||||
return SPELL_FAILED_NO_PET;
|
return SPELL_FAILED_NO_PET;
|
||||||
}
|
}
|
||||||
|
else if (!pet->isAlive())
|
||||||
|
return SPELL_FAILED_TARGETS_DEAD;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11980"
|
#define REVISION_NR "11981"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue