don't capture dead actors
This commit is contained in:
@@ -39,6 +39,9 @@ namespace OpenRA.Mods.RA.Activities
|
|||||||
|
|
||||||
self.World.AddFrameEndTask(w =>
|
self.World.AddFrameEndTask(w =>
|
||||||
{
|
{
|
||||||
|
if (actor.IsDead())
|
||||||
|
return;
|
||||||
|
|
||||||
var lowEnoughHealth = health.HP <= capturableInfo.CaptureThreshold * health.MaxHP;
|
var lowEnoughHealth = health.HP <= capturableInfo.CaptureThreshold * health.MaxHP;
|
||||||
if (!capturesInfo.Sabotage || lowEnoughHealth || actor.Owner.NonCombatant)
|
if (!capturesInfo.Sabotage || lowEnoughHealth || actor.Owner.NonCombatant)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ namespace OpenRA.Mods.RA.Activities
|
|||||||
|
|
||||||
self.World.AddFrameEndTask(w =>
|
self.World.AddFrameEndTask(w =>
|
||||||
{
|
{
|
||||||
|
if (target.Actor.IsDead())
|
||||||
|
return;
|
||||||
|
|
||||||
var oldOwner = target.Actor.Owner;
|
var oldOwner = target.Actor.Owner;
|
||||||
|
|
||||||
target.Actor.ChangeOwner(self.Owner);
|
target.Actor.ChangeOwner(self.Owner);
|
||||||
|
|||||||
Reference in New Issue
Block a user