Jump to content

[fix] Disengage usable only in combat


Auntie Mangos

Recommended Posts

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

Patch restricts usage of Disengage to "in combat use" only

For which repository revision was the patch created?

[9549]

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

http://getmangos.eu/community/showthread.php?12208-[9082]-Disengage

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

Me

patch:

src/game/Spell.cpp |    8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index a4a47b5..965c351 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -4885,6 +4885,14 @@ SpellCastResult Spell::CheckCast(bool strict)
                    return SPELL_FAILED_BAD_TARGETS;
                break;
            }
+            case SPELL_EFFECT_LEAP_BACK:
+            {
+                if (m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER)
+                    if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000400000000000)) // Disengage
+                        if(!m_caster->isInCombat()) 
+                            return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; 
+                break;
+            }
            default:break;
        }
    } 

Link to comment
Share on other sites

  • 40 years later...

More simple version

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 4e4c41a..ec1aec4 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -4899,6 +4899,13 @@ SpellCastResult Spell::CheckCast(bool strict)
                    return SPELL_FAILED_BAD_TARGETS;
                break;
            }
+            case SPELL_EFFECT_LEAP_BACK:
+            {
+                if(m_spellInfo->Id == 781)
+                    if(!m_caster->isInCombat()) 
+                        return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; 
+                break;
+            }
            default:break;
        }
    }

Link to comment
Share on other sites

Guest
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