Core/Spells: correctly get magnet target. (subv fixed it) Closes #6674
This commit is contained in:
@@ -10034,7 +10034,7 @@ Unit* Unit::GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo)
|
|||||||
Unit::AuraEffectList const& magnetAuras = victim->GetAuraEffectsByType(SPELL_AURA_SPELL_MAGNET);
|
Unit::AuraEffectList const& magnetAuras = victim->GetAuraEffectsByType(SPELL_AURA_SPELL_MAGNET);
|
||||||
for (Unit::AuraEffectList::const_iterator itr = magnetAuras.begin(); itr != magnetAuras.end(); ++itr)
|
for (Unit::AuraEffectList::const_iterator itr = magnetAuras.begin(); itr != magnetAuras.end(); ++itr)
|
||||||
{
|
{
|
||||||
if (Unit* magnet = (*itr)->GetBase()->GetUnitOwner())
|
if (Unit* magnet = (*itr)->GetBase()->GetCaster())
|
||||||
if (spellInfo->CheckExplicitTarget(this, magnet) == SPELL_CAST_OK
|
if (spellInfo->CheckExplicitTarget(this, magnet) == SPELL_CAST_OK
|
||||||
&& spellInfo->CheckTarget(this, magnet, false) == SPELL_CAST_OK
|
&& spellInfo->CheckTarget(this, magnet, false) == SPELL_CAST_OK
|
||||||
&& _IsValidAttackTarget(magnet, spellInfo)
|
&& _IsValidAttackTarget(magnet, spellInfo)
|
||||||
|
|||||||
Reference in New Issue
Block a user