Core/Spells: Prevent attacking friendly targets by SPELL_ATTR7_ATTACK_ON_CHARGE_TO_UNIT

Signed-off-by: luis <[email protected]>
This commit is contained in:
Shauren
2026-02-15 17:39:49 -03:00
committed by luis
parent 9f5502aa3f
commit 5e826f3fd1
+1 -1
View File
@@ -3972,7 +3972,7 @@ void Spell::EffectCharge()
if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT_TARGET)
{
// not all charge effects used in negative spells
if (m_spellInfo->HasAttribute(SPELL_ATTR7_ATTACK_ON_CHARGE_TO_UNIT))
if (m_spellInfo->HasAttribute(SPELL_ATTR7_ATTACK_ON_CHARGE_TO_UNIT) && unitCaster->IsValidAttackTarget(unitTarget))
unitCaster->Attack(unitTarget, true);
if (effectInfo->TriggerSpell)