diff --git a/OpenRA.Mods.Common/Warheads/DamageWarhead.cs b/OpenRA.Mods.Common/Warheads/DamageWarhead.cs index 6e00e11229..3066758953 100644 --- a/OpenRA.Mods.Common/Warheads/DamageWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/DamageWarhead.cs @@ -65,6 +65,9 @@ namespace OpenRA.Mods.Common.Warheads public virtual void DoImpact(Actor victim, Actor firedBy, IEnumerable damageModifiers) { + if (!IsValidAgainst(victim, firedBy)) + return; + var damage = Util.ApplyPercentageModifiers(Damage, damageModifiers.Append(DamageVersus(victim))); victim.InflictDamage(firedBy, damage, this); } diff --git a/OpenRA.Mods.Common/Warheads/HealthPercentageDamageWarhead.cs b/OpenRA.Mods.Common/Warheads/HealthPercentageDamageWarhead.cs index e01e0a6c5e..9086227f3e 100644 --- a/OpenRA.Mods.Common/Warheads/HealthPercentageDamageWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/HealthPercentageDamageWarhead.cs @@ -42,6 +42,9 @@ namespace OpenRA.Mods.Common.Warheads public override void DoImpact(Actor victim, Actor firedBy, IEnumerable damageModifiers) { + if (!IsValidAgainst(victim, firedBy)) + return; + var healthInfo = victim.Info.TraitInfoOrDefault(); if (healthInfo == null) return; diff --git a/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs b/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs index 3c93865f7c..60d3f985d7 100644 --- a/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs @@ -62,9 +62,6 @@ namespace OpenRA.Mods.Common.Warheads foreach (var victim in hitActors) { - if (!IsValidAgainst(victim, firedBy)) - continue; - var healthInfo = victim.Info.TraitInfoOrDefault(); if (healthInfo == null) continue;