From 133a0f54a3673a84ebfff671fc967421d81af3f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Mon, 28 Mar 2016 10:20:30 +0200 Subject: [PATCH] Check for invalid targets to avoid crashing. --- OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs b/OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs index 6863f92587..4d0304ca2d 100644 --- a/OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs @@ -91,6 +91,9 @@ namespace OpenRA.Mods.Common.Warheads public override void DoImpact(Target target, Actor firedBy, IEnumerable damageModifiers) { + if (!target.IsValidFor(firedBy)) + return; + var pos = target.CenterPosition; var world = firedBy.World; var targetTile = world.Map.CellContaining(pos);