Jump to content

Recommended Posts

Posted

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

fixes bug when periodic auras were still modifying target health when target is not alive

For which repository revision was the patch created?

9266

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?12119-[bUG]-Lifestone

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

me

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 2361d5e..d6827a6 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -6832,6 +6832,10 @@ void Aura::PeriodicTick()
            Unit *pCaster = GetCaster();
            if(!pCaster)
                return;
+            
+            // don't heal target if not alive
+            if (!m_target->isAlive())
+                return;

            // heal for caster damage (must be alive)
            if(m_target != pCaster && GetSpellProto()->SpellVisual[0] == 163 && !pCaster->isAlive())
@@ -7082,7 +7086,10 @@ void Aura::PeriodicTick()
            break;
        }
        case SPELL_AURA_MOD_REGEN:
-        {
+        {
+            if (!m_target->isAlive())
+                return;
+
            int32 gain = m_target->ModifyHealth(m_modifier.m_amount);
            if (Unit *caster = GetCaster())
                m_target->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellProto());

maybe "if (!target->isAlive())" in first diff can be replaced by "if (m_target == pCaster && !pCaster->isAlive())" but I don't know which one is better

  • 40 years later...
Posted

it is not related to a check if spell can or can't be casted on death. I don't think any aura that modifies hp should be able to do it if the target is dead with 0 hp

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