From a68467292ee51dede2b0a627a14f795a3601b437 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Fri, 8 May 2020 15:08:50 +0200 Subject: [PATCH] Use TargetType.Invalid checks instead of IsValidFor --- OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs | 4 ++-- OpenRA.Mods.Common/Warheads/FireClusterWarhead.cs | 4 ++-- OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) 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))