mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
*Fix devour magic cast on enemy.
--HG-- branch : trunk
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user