Jump to content

[fix]Wild Growth targeting


Guest laise

Recommended Posts

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

fixes Wild Growth heal applying to enemy target

For which repository revision was the patch created?

9639

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

haven't seen any

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 b7a1acd..e328418 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1758,8 +1758,11 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
                Unit* target = m_targets.getUnitTarget();
                if(!target)
                    target = m_caster;
-                uint32 count = CalculateDamage(EFFECT_INDEX_2,m_caster); // stored in dummy effect, affected by mods
+                // prevent center adding to heal list
+                else if (!m_caster->IsFriendlyTo(target))
+                    targetUnitMap.remove(target);

+                uint32 count = CalculateDamage(EFFECT_INDEX_2,m_caster); // stored in dummy effect, affected by mods
                FillRaidOrPartyHealthPriorityTargets(targetUnitMap, m_caster, target, radius, count, true, false, true);
            }
            else

Link to comment
Share on other sites

when i did research about this it only happened when you targetted an enemy (applied to "friends of enemies"), so adding a rule in CheckCast() was enough

           case SPELL_EFFECT_APPLY_AURA:
           {
               // Wild Growth
               if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags & UI64LIT(0x0400000000000000))
               {
                   Unit *target = m_targets.getUnitTarget();
                   if (!target)
                       return SPELL_FAILED_BAD_IMPLICIT_TARGETS;

                   // avoid casting on non friendly targets
                   if (!m_caster->IsFriendlyTo(target))
                       return SPELL_FAILED_BAD_TARGETS;
               }
               break;

Link to comment
Share on other sites

×
×
  • 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