diff --git a/OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs b/OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs index a59a72438d..5b9666ee3f 100644 --- a/OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs @@ -102,10 +102,10 @@ namespace OpenRA.Mods.Common.Warheads public override void DoImpact(Target target, WarheadArgs args) { - var firedBy = args.SourceActor; - if (!target.IsValidFor(firedBy)) + if (target.Type == TargetType.Invalid) return; + var firedBy = args.SourceActor; var pos = target.CenterPosition; var world = firedBy.World; var targetTile = world.Map.CellContaining(pos); diff --git a/OpenRA.Mods.Common/Warheads/FireClusterWarhead.cs b/OpenRA.Mods.Common/Warheads/FireClusterWarhead.cs index 6ba7fda4da..8af98cdab1 100644 --- a/OpenRA.Mods.Common/Warheads/FireClusterWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/FireClusterWarhead.cs @@ -46,10 +46,10 @@ namespace OpenRA.Mods.Common.Warheads public override void DoImpact(Target target, WarheadArgs args) { - var firedBy = args.SourceActor; - if (!target.IsValidFor(firedBy)) + if (target.Type == TargetType.Invalid) return; + var firedBy = args.SourceActor; var map = firedBy.World.Map; var targetCell = map.CellContaining(target.CenterPosition); diff --git a/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs b/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs index e2982687d5..7ce6dd65b5 100644 --- a/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs @@ -31,10 +31,10 @@ namespace OpenRA.Mods.Common.Warheads public override void DoImpact(Target target, WarheadArgs args) { - var firedBy = args.SourceActor; - if (!target.IsValidFor(firedBy)) + if (target.Type == TargetType.Invalid) return; + var firedBy = args.SourceActor; var world = firedBy.World; if (Chance < world.LocalRandom.Next(100))