aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 38e66a218f8..6587ce71b61 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -4938,6 +4938,24 @@ SpellCastResult Spell::CheckCast(bool strict)
if (castResult != SPELL_CAST_OK)
return castResult;
+ bool hasDispellableAura = false;
+ for (int i = 0; i < MAX_SPELL_EFFECTS; i++)
+ if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_DISPEL)
+ if (Unit* target = m_targets.GetUnitTarget())
+ {
+ DispelChargesList dispelList;
+ uint32 dispelMask = SpellInfo::GetDispelMask(DispelType(m_spellInfo->Effects[i].MiscValue));
+ target->GetDispellableAuraList(m_caster, dispelMask, dispelList);
+ if (!dispelList.empty())
+ {
+ hasDispellableAura = true;
+ break;
+ }
+ }
+
+ if (!hasDispellableAura)
+ return SPELL_FAILED_NOTHING_TO_DISPEL;
+
for (int i = 0; i < MAX_SPELL_EFFECTS; i++)
{
// for effects of spells that have only one target