Convert IFacing.Facing and TurnSpeed to WAngle.

This commit is contained in:
Paul Chote
2020-06-01 20:42:28 +01:00
committed by teinarss
parent 01417c88c5
commit 6adf45bcb4
44 changed files with 101 additions and 120 deletions

View File

@@ -69,7 +69,7 @@ namespace OpenRA.Mods.Common.Traits
public WPos CenterPosition { get; private set; }
[Sync]
public int Facing { get; set; }
public WAngle Facing { get; set; }
public int TurnSpeed { get { return 0; } }
@@ -80,7 +80,7 @@ namespace OpenRA.Mods.Common.Traits
TopLeft = init.GetValue<LocationInit, CPos>(info);
CenterPosition = init.GetValue<CenterPositionInit, WPos>(info, init.World.Map.CenterOfCell(TopLeft));
Facing = init.GetValue<FacingInit, int>(info, 128);
Facing = WAngle.FromFacing(init.GetValue<FacingInit, int>(info, 128));
dragSpeed = init.GetValue<HuskSpeedInit, int>(info, 0);
finalPosition = init.World.Map.CenterOfCell(TopLeft);
@@ -163,7 +163,7 @@ namespace OpenRA.Mods.Common.Traits
void IDeathActorInitModifier.ModifyDeathActorInit(Actor self, TypeDictionary init)
{
init.Add(new FacingInit(Facing));
init.Add(new FacingInit(Facing.Facing));
}
// We return self.Owner if there's no effective owner