diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Spell.cpp | 3 | ||||
-rw-r--r-- | src/game/SpellMgr.h | 16 |
2 files changed, 13 insertions, 6 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 989aa37bc5c..7dc138dcff4 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -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 diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 04a9f2c621f..6f645406dc6 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -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; } |