From 70babb40672f31439eb302676c78e9bcfa252dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Mon, 20 Apr 2020 20:17:27 +0200 Subject: [PATCH] Validate the target before querying it's center position. --- OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs b/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs index bfaf040acc..d006a16311 100644 --- a/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/LeaveSmudgeWarhead.cs @@ -35,6 +35,9 @@ namespace OpenRA.Mods.Common.Warheads public override void DoImpact(Target target, WarheadArgs args) { var firedBy = args.SourceActor; + if (!target.IsValidFor(firedBy)) + return; + var world = firedBy.World; if (Chance < world.LocalRandom.Next(100))