From 5a0c1459b29440c9c566268104d49d8db78d99db Mon Sep 17 00:00:00 2001 From: Mustafa Alperen Seki Date: Mon, 29 Oct 2018 19:58:23 +0300 Subject: [PATCH] Add MPSpawnUnits>BaseActorOffset --- OpenRA.Mods.Common/Traits/World/MPStartUnits.cs | 5 ++++- OpenRA.Mods.Common/Traits/World/SpawnMPUnits.cs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/World/MPStartUnits.cs b/OpenRA.Mods.Common/Traits/World/MPStartUnits.cs index d4d8523fdb..965637d01e 100644 --- a/OpenRA.Mods.Common/Traits/World/MPStartUnits.cs +++ b/OpenRA.Mods.Common/Traits/World/MPStartUnits.cs @@ -26,9 +26,12 @@ namespace OpenRA.Mods.Common.Traits [Desc("Only available when selecting one of these factions.", "Leave empty for no restrictions.")] public readonly HashSet Factions = new HashSet(); - [Desc("The mobile construction vehicle.")] + [Desc("The actor at the center, usually the mobile construction vehicle.")] public readonly string BaseActor = null; + [Desc("Offset from the spawn point, BaseActor will spawn at.")] + public readonly CVec BaseActorOffset = CVec.Zero; + [Desc("A group of units ready to defend or scout.")] public readonly string[] SupportActors = { }; diff --git a/OpenRA.Mods.Common/Traits/World/SpawnMPUnits.cs b/OpenRA.Mods.Common/Traits/World/SpawnMPUnits.cs index 08648f6400..2458f874e2 100644 --- a/OpenRA.Mods.Common/Traits/World/SpawnMPUnits.cs +++ b/OpenRA.Mods.Common/Traits/World/SpawnMPUnits.cs @@ -87,7 +87,7 @@ namespace OpenRA.Mods.Common.Traits { w.CreateActor(unitGroup.BaseActor.ToLowerInvariant(), new TypeDictionary { - new LocationInit(sp), + new LocationInit(sp + unitGroup.BaseActorOffset), new OwnerInit(p), new SkipMakeAnimsInit(), new FacingInit(unitGroup.BaseActorFacing < 0 ? w.SharedRandom.Next(256) : unitGroup.BaseActorFacing),