From e666c75883568ac30522bb0ebb32fb58317ec7a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 3 Jul 2014 10:33:41 +0200 Subject: [PATCH] don't capture dead actors --- OpenRA.Mods.RA/Activities/CaptureActor.cs | 3 +++ OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/OpenRA.Mods.RA/Activities/CaptureActor.cs b/OpenRA.Mods.RA/Activities/CaptureActor.cs index e0118954d4..c02cfd83f2 100644 --- a/OpenRA.Mods.RA/Activities/CaptureActor.cs +++ b/OpenRA.Mods.RA/Activities/CaptureActor.cs @@ -39,6 +39,9 @@ namespace OpenRA.Mods.RA.Activities self.World.AddFrameEndTask(w => { + if (actor.IsDead()) + return; + var lowEnoughHealth = health.HP <= capturableInfo.CaptureThreshold * health.MaxHP; if (!capturesInfo.Sabotage || lowEnoughHealth || actor.Owner.NonCombatant) { diff --git a/OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs b/OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs index 9274889bd1..6d1e619b3f 100644 --- a/OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs +++ b/OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs @@ -59,6 +59,9 @@ namespace OpenRA.Mods.RA.Activities self.World.AddFrameEndTask(w => { + if (target.Actor.IsDead()) + return; + var oldOwner = target.Actor.Owner; target.Actor.ChangeOwner(self.Owner);