Core/Spells: Prevent attacking friendly targets by SPELL_ATTR7_ATTACK_ON_CHARGE_TO_UNIT

This commit is contained in:
Shauren
2026-02-15 01:07:11 +01:00
parent 705e19dd0d
commit 3e79490761

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)