From 68a97b079b5ae7d01fef8a5fda85e17d042b8135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 2 Jul 2014 19:23:14 +0200 Subject: [PATCH 1/4] spurious tab --- OpenRA.Mods.RA/Buildings/BuildingInfluence.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Buildings/BuildingInfluence.cs b/OpenRA.Mods.RA/Buildings/BuildingInfluence.cs index 8ccaf15509..e8a16acaec 100755 --- a/OpenRA.Mods.RA/Buildings/BuildingInfluence.cs +++ b/OpenRA.Mods.RA/Buildings/BuildingInfluence.cs @@ -28,7 +28,7 @@ namespace OpenRA.Mods.RA.Buildings influence = new CellLayer(map); - world.ActorAdded += a => + world.ActorAdded += a => { var b = a.TraitOrDefault(); if (b == null) From 3c3f85a272511fe1f18a9c0f83c101e2b6e17770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 2 Jul 2014 19:23:25 +0200 Subject: [PATCH 2/4] add documentation --- OpenRA.Mods.RA/Buildings/BuildingInfluence.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenRA.Mods.RA/Buildings/BuildingInfluence.cs b/OpenRA.Mods.RA/Buildings/BuildingInfluence.cs index e8a16acaec..71dcec3ced 100755 --- a/OpenRA.Mods.RA/Buildings/BuildingInfluence.cs +++ b/OpenRA.Mods.RA/Buildings/BuildingInfluence.cs @@ -12,6 +12,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA.Buildings { + [Desc("A dictionary of buildings placed on the map. Attach this to the world actor.")] public class BuildingInfluenceInfo : ITraitInfo { public object Create(ActorInitializer init) { return new BuildingInfluence(init.world); } From 04f1ebe9690e3a5601baa8c13287a93b66a97a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 3 Jul 2014 09:19:51 +0200 Subject: [PATCH 3/4] abort change owner when the actor is destroyed fixes #5638 --- OpenRA.Game/Actor.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRA.Game/Actor.cs b/OpenRA.Game/Actor.cs index d15c0cdbf6..066b5277a0 100644 --- a/OpenRA.Game/Actor.cs +++ b/OpenRA.Game/Actor.cs @@ -217,6 +217,9 @@ namespace OpenRA { World.AddFrameEndTask(w => { + if (this.Destroyed) + return; + var oldOwner = Owner; // momentarily remove from world so the ownership queries don't get confused 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 4/4] 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);