From 86bfd4700fe92845d1409567dc74209e6713ff52 Mon Sep 17 00:00:00 2001 From: Zimmermann Gyula Date: Mon, 18 Jun 2018 09:22:03 +0200 Subject: [PATCH] Implement DeathTypes support to OwnerLostAction. --- OpenRA.Mods.Common/Traits/OwnerLostAction.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/OwnerLostAction.cs b/OpenRA.Mods.Common/Traits/OwnerLostAction.cs index 60fd1de903..892a45f262 100644 --- a/OpenRA.Mods.Common/Traits/OwnerLostAction.cs +++ b/OpenRA.Mods.Common/Traits/OwnerLostAction.cs @@ -9,6 +9,7 @@ */ #endregion +using System.Collections.Generic; using System.Linq; using OpenRA.Traits; @@ -27,6 +28,9 @@ namespace OpenRA.Mods.Common.Traits [Desc("Map player to use when 'Action' is 'ChangeOwner'.")] public readonly string Owner = "Neutral"; + [Desc("The deathtypes used when 'Action' is 'Kill'.")] + public readonly HashSet DeathTypes = new HashSet(); + public override object Create(ActorInitializer init) { return new OwnerLostAction(init, this); } } @@ -41,7 +45,7 @@ namespace OpenRA.Mods.Common.Traits return; if (Info.Action == OwnerLostActionType.Kill) - self.Kill(self); + self.Kill(self, Info.DeathTypes); else if (Info.Action == OwnerLostActionType.Dispose) self.Dispose(); else if (Info.Action == OwnerLostActionType.ChangeOwner)