From 7416cd0ac1ddcfe7cd5360bc8f5cd0fd6cd3655c Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Tue, 11 Apr 2017 15:10:33 +0200 Subject: [PATCH] Add an Offset property to SpawnActorOnDeath --- OpenRA.Mods.Common/Traits/SpawnActorOnDeath.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/SpawnActorOnDeath.cs b/OpenRA.Mods.Common/Traits/SpawnActorOnDeath.cs index 139bb3c61e..b597b7bcc6 100644 --- a/OpenRA.Mods.Common/Traits/SpawnActorOnDeath.cs +++ b/OpenRA.Mods.Common/Traits/SpawnActorOnDeath.cs @@ -45,6 +45,11 @@ namespace OpenRA.Mods.Common.Traits [Desc("Should an actor only be spawned when the 'Creeps' setting is true?")] public readonly bool RequiresLobbyCreeps = false; + [Desc("Offset of the spawned actor relative to the dying actor's position.", + "Warning: Spawning an actor outside the parent actor's footprint/influence might", + "lead to unexpected behaviour.")] + public readonly CVec Offset = CVec.Zero; + public object Create(ActorInitializer init) { return new SpawnActorOnDeath(init, this); } } @@ -84,7 +89,7 @@ namespace OpenRA.Mods.Common.Traits var td = new TypeDictionary { new ParentActorInit(self), - new LocationInit(self.Location), + new LocationInit(self.Location + info.Offset), new CenterPositionInit(self.CenterPosition), new FactionInit(faction) };