Jump to content

[fix]Seed of Corruption damaging friendly targets


Auntie Mangos

Recommended Posts

  • 40 years later...

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

fixes Seed of Corruption damaging friendly targets

For which repository revision was the patch created?

9618

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

don't remember

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

me

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 5e42bab..f7f1a39 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -6416,8 +6416,5 @@ void Spell::FillRaidOrPartyHealthPriorityTargets(UnitList &targetUnitMap, Unit*

WorldObject* Spell::GetCastingObject() const
{
-    if (m_originalCasterGUID.IsGameobject())
-        return m_caster->IsInWorld() ? m_caster->GetMap()->GetGameObject(m_originalCasterGUID) : NULL;
-    else
-        return m_caster;
+    return m_caster->IsInWorld() && !m_originalCasterGUID.IsEmpty() && m_caster->GetObjectGuid() != m_originalCasterGUID ? m_caster->GetMap()->GetWorldObject(m_originalCasterGUID) : m_caster;
}

hope it doesn't break anything on the way

Link to comment
Share on other sites

it seems to work fine on 0.12 with this patch:

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 6975066..e4a5bc8 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -5678,8 +5678,6 @@ void Spell::FillRaidOrPartyTargets( UnitList &TagUnitMap, Unit* target, float ra

WorldObject* Spell::GetCastingObject() const
{
-    if (IS_GAMEOBJECT_GUID(m_originalCasterGUID))
-        return m_caster->IsInWorld() ? m_caster->GetMap()->GetGameObject(m_originalCasterGUID) : NULL;
-    else
-        return m_caster;
+    return (m_caster->IsInWorld() && m_originalCasterGUID && m_caster->GetGUID() != m_originalCasterGUID) ?
+        Unit::GetUnit(*m_caster, m_originalCasterGUID) : m_caster;
}

but we haven't tested much yet.. next week might be better results

Link to comment
Share on other sites

it seems to work fine on 0.12 with this patch:

You're the best Balrok - that seems to work fine indeed (turns out I had changed it to the wrong return unit when I rewrote it myself.. Mangos core is tricky :D). Will probably put this on our live server in a day or so, if I find any problems with it I'll let you know :)

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

This is good case when reports that some spells fixed not prove that original patch is correct.

Spell::GetCastingObject exist for poting to object who _visual_ cast some effect, in case Seed this is affected unit by Seed aura. And _must be_ this unit.

Main porblem in using this function wrongly in SpellNotifier*.

In [9850] fixed in more correct way as i think.

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