[11887] Fix spell targeting for pet spells with target-type (0,0)

Also some style improvements

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
rsa 2012-01-20 12:28:24 +04:00 committed by Schmoozerd
parent d1a45fed71
commit df9e0ebf6a
2 changed files with 9 additions and 6 deletions

View file

@ -471,11 +471,14 @@ void Spell::FillTargetMap()
// but need it support in some know cases
switch(m_spellInfo->EffectImplicitTargetA[i])
{
case 0:
case TARGET_NONE:
switch(m_spellInfo->EffectImplicitTargetB[i])
{
case 0:
SetTargetMap(SpellEffectIndex(i), TARGET_EFFECT_SELECT, tmpUnitMap);
case TARGET_NONE:
if (m_caster->GetObjectGuid().IsPet())
SetTargetMap(SpellEffectIndex(i), TARGET_SELF, tmpUnitMap);
else
SetTargetMap(SpellEffectIndex(i), TARGET_EFFECT_SELECT, tmpUnitMap);
break;
default:
SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetB[i], tmpUnitMap);
@ -485,7 +488,7 @@ void Spell::FillTargetMap()
case TARGET_SELF:
switch(m_spellInfo->EffectImplicitTargetB[i])
{
case 0:
case TARGET_NONE:
case TARGET_EFFECT_SELECT:
SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetA[i], tmpUnitMap);
break;
@ -506,7 +509,7 @@ void Spell::FillTargetMap()
case TARGET_EFFECT_SELECT:
switch(m_spellInfo->EffectImplicitTargetB[i])
{
case 0:
case TARGET_NONE:
case TARGET_EFFECT_SELECT:
SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetA[i], tmpUnitMap);
break;