*Fix devour magic cast on enemy.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-01-20 21:10:38 +01:00
parent 15403f0a8f
commit ed15b99ee9
2 changed files with 13 additions and 6 deletions

View File

@@ -3440,7 +3440,8 @@ uint8 Spell::CanCast(bool strict)
// check correctness positive/negative cast target (pet cast real check and cheating check)
if(IsPositiveSpell(m_spellInfo->Id))
{
if(m_caster->IsHostileTo(target))
//dispel positivity is dependant on target, don't check it
if(m_caster->IsHostileTo(target) && !IsDispel(m_spellInfo))
return SPELL_FAILED_BAD_TARGETS;
}
else

View File

@@ -382,16 +382,22 @@ inline bool IsAreaAuraEffect(uint32 effect)
return true;
return false;
}
inline bool IsDispelSpell(SpellEntry const *spellInfo)
inline bool IsDispel(SpellEntry const *spellInfo)
{
//spellsteal is also dispel
if (spellInfo->Effect[0] == SPELL_EFFECT_DISPEL ||
spellInfo->Effect[0] == SPELL_EFFECT_STEAL_BENEFICIAL_BUFF ||
spellInfo->Effect[1] == SPELL_EFFECT_DISPEL ||
spellInfo->Effect[2] == SPELL_EFFECT_DISPEL)
return true;
return false;
}
inline bool IsDispelSpell(SpellEntry const *spellInfo)
{
//spellsteal is also dispel
if (spellInfo->Effect[0] == SPELL_EFFECT_STEAL_BENEFICIAL_BUFF ||
spellInfo->Effect[1] == SPELL_EFFECT_STEAL_BENEFICIAL_BUFF ||
spellInfo->Effect[2] == SPELL_EFFECT_DISPEL ||
spellInfo->Effect[2] == SPELL_EFFECT_STEAL_BENEFICIAL_BUFF)
spellInfo->Effect[2] == SPELL_EFFECT_STEAL_BENEFICIAL_BUFF
||IsDispel(spellInfo))
return true;
return false;
}