diff --git a/OpenRA.Mods.RA/Air/HeliReturn.cs b/OpenRA.Mods.RA/Air/HeliReturn.cs index 5b11319df0..2e5fc65592 100755 --- a/OpenRA.Mods.RA/Air/HeliReturn.cs +++ b/OpenRA.Mods.RA/Air/HeliReturn.cs @@ -51,7 +51,7 @@ namespace OpenRA.Mods.RA.Air heli.Reservation = res.Reserve(dest, self, heli); var exit = dest.Info.Traits.WithInterface().FirstOrDefault(); - var offset = (exit != null) ? exit.SpawnOffsetVector : WVec.Zero; + var offset = (exit != null) ? exit.SpawnOffset : WVec.Zero; return Util.SequenceActivities( new HeliFly(dest.CenterPosition + offset), diff --git a/OpenRA.Mods.RA/Air/Helicopter.cs b/OpenRA.Mods.RA/Air/Helicopter.cs index 052e0b6052..b3eaac30a1 100755 --- a/OpenRA.Mods.RA/Air/Helicopter.cs +++ b/OpenRA.Mods.RA/Air/Helicopter.cs @@ -73,7 +73,7 @@ namespace OpenRA.Mods.RA.Air Reservation = res.Reserve(order.TargetActor, self, this); var exit = order.TargetActor.Info.Traits.WithInterface().FirstOrDefault(); - var offset = (exit != null) ? exit.SpawnOffsetVector : WVec.Zero; + var offset = (exit != null) ? exit.SpawnOffset : WVec.Zero; self.SetTargetLine(Target.FromActor(order.TargetActor), Color.Green); diff --git a/OpenRA.Mods.RA/Missions/DesertShellmapScript.cs b/OpenRA.Mods.RA/Missions/DesertShellmapScript.cs index 8fe61fd133..b578c89729 100644 --- a/OpenRA.Mods.RA/Missions/DesertShellmapScript.cs +++ b/OpenRA.Mods.RA/Missions/DesertShellmapScript.cs @@ -219,7 +219,7 @@ namespace OpenRA.Mods.RA.Missions cargo.Load(chinook, world.CreateActor(false, ChinookCargo.Random(world.SharedRandom), allies, null, null)); var exit = lz.Info.Traits.WithInterface().FirstOrDefault(); - var offset = (exit != null) ? exit.SpawnOffsetVector : WVec.Zero; + var offset = (exit != null) ? exit.SpawnOffset : WVec.Zero; chinook.QueueActivity(new HeliFly(lz.CenterPosition + offset)); // no reservation of hpad but it's not needed chinook.QueueActivity(new Turn(0)); diff --git a/OpenRA.Mods.RA/Production.cs b/OpenRA.Mods.RA/Production.cs index bb6264ab30..aeb7b2754f 100755 --- a/OpenRA.Mods.RA/Production.cs +++ b/OpenRA.Mods.RA/Production.cs @@ -28,13 +28,12 @@ namespace OpenRA.Mods.RA [Desc("Where the unit should leave the building. Multiples are allowed if IDs are added: Exit@2, ...")] public class ExitInfo : TraitInfo { - public readonly int2 SpawnOffset = int2.Zero; // in px relative to CenterLocation - public readonly int2 ExitCell = int2.Zero; // in cells relative to TopLeft - public readonly int Facing = -1; + [Desc("Offset at which that the exiting actor is spawned")] + public readonly WVec SpawnOffset = WVec.Zero; - // TODO: Push this conversion into the yaml - public WVec SpawnOffsetVector { get { return new WVec(SpawnOffset.X, SpawnOffset.Y, 0) * 1024 / Game.CellSize; } } - public CVec ExitCellVector { get { return (CVec)ExitCell; } } + [Desc("Cell offset where the exiting actor enters the ActorMap")] + public readonly CVec ExitCell = CVec.Zero; + public readonly int Facing = -1; } public class Exit { } @@ -49,8 +48,8 @@ namespace OpenRA.Mods.RA public void DoProduction(Actor self, ActorInfo producee, ExitInfo exitinfo) { - var exit = self.Location + exitinfo.ExitCellVector; - var spawn = self.CenterPosition + exitinfo.SpawnOffsetVector; + var exit = self.Location + exitinfo.ExitCell; + var spawn = self.CenterPosition + exitinfo.SpawnOffset; var to = exit.CenterPosition; var fi = producee.Traits.Get(); @@ -126,7 +125,7 @@ namespace OpenRA.Mods.RA var mobileInfo = producee.Traits.GetOrDefault(); return mobileInfo == null || - mobileInfo.CanEnterCell(self.World, self, self.Location + s.ExitCellVector, self, true, true); + mobileInfo.CanEnterCell(self.World, self, self.Location + s.ExitCell, self, true, true); } } }