Change Exit.SpawnOffsetVector to WVec.
This commit is contained in:
@@ -31,13 +31,15 @@ namespace OpenRA.Mods.RA
|
||||
public class ExitInfo : TraitInfo<Exit>
|
||||
{
|
||||
public readonly int2 SpawnOffset = int2.Zero; // in px relative to CenterLocation
|
||||
public readonly int2 ExitCell = int2.Zero; // in cells relative to TopLeft
|
||||
public readonly int2 ExitCell = int2.Zero; // in cells relative to TopLeft
|
||||
public readonly int Facing = -1;
|
||||
|
||||
public PVecInt SpawnOffsetVector { get { return (PVecInt)SpawnOffset; } }
|
||||
// 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; } }
|
||||
}
|
||||
public class Exit {}
|
||||
|
||||
public class Exit { }
|
||||
|
||||
public class Production
|
||||
{
|
||||
@@ -50,7 +52,7 @@ namespace OpenRA.Mods.RA
|
||||
public void DoProduction(Actor self, ActorInfo producee, ExitInfo exitinfo)
|
||||
{
|
||||
var exit = self.Location + exitinfo.ExitCellVector;
|
||||
var spawn = (self.Trait<IHasLocation>().PxPosition + exitinfo.SpawnOffsetVector).ToWPos(0);
|
||||
var spawn = self.CenterPosition + exitinfo.SpawnOffsetVector;
|
||||
var to = exit.CenterPosition;
|
||||
|
||||
var fi = producee.Traits.Get<IFacingInfo>();
|
||||
|
||||
Reference in New Issue
Block a user