Jump to content

[patch] Devour Magic (purge part)

Auntie Mangos

Recommended Posts

What bug does the patch fix? What features does the patch add?

It fixes the purge part of felhunter's Devour Magic spell, which didn't work due to two checks with wrong results of function "IsPositiveSpell()".

For which repository revision was the patch created?

Rev. 9020

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.


Who has been writing this patch? Please include either forum user names or email addresses.

Me, reeshack.

paste2.org: http://paste2.org/p/574361

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index cf8ffaa..4083525 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -4094,7 +4094,7 @@ SpellCastResult Spell::CheckCast(bool strict)
            // TODO: this check can be applied and for player to prevent cheating when IsPositiveSpell will return always correct result.
            // check target for pet/charmed casts (not self targeted), self targeted cast used for area effects and etc
-            else if (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->GetCharmerOrOwnerGUID())
+            else if (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->GetCharmerOrOwnerGUID() && !IsDispelSpell(m_spellInfo))
                // check correctness positive/negative cast target (pet cast real check and cheating check)
@@ -4931,7 +4931,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
                return SPELL_FAILED_BAD_TARGETS;

-            if(IsPositiveSpell(m_spellInfo->Id))
+            if(IsPositiveSpell(m_spellInfo->Id) && !IsDispelSpell(m_spellInfo))
                    return SPELL_FAILED_BAD_TARGETS;
@@ -4944,7 +4944,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
                                                            //TARGET_DUELVSPLAYER is positive AND negative
                    duelvsplayertar |= (m_spellInfo->EffectImplicitTargetA[j] == TARGET_DUELVSPLAYER);
-                if(m_caster->IsFriendlyTo(target) && !duelvsplayertar)
+                if(m_caster->IsFriendlyTo(target) && !duelvsplayertar && !IsDispelSpell(m_spellInfo))
                    return SPELL_FAILED_BAD_TARGETS;

Link to comment
Share on other sites

  • 39 years later...
  • 3 weeks later...
This topic is now closed to further replies.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use