Convert yaml-exposed facings to WAngle.

This commit is contained in:
Paul Chote
2020-07-09 22:08:38 +01:00
committed by reaperrr
parent 6d12301f88
commit ac975f4139
80 changed files with 477 additions and 370 deletions

View File

@@ -56,8 +56,8 @@ namespace OpenRA.Mods.Common.Traits
var spawn = self.CenterPosition + exitinfo.SpawnOffset;
var to = self.World.Map.CenterOfCell(exit);
var initialFacing = WAngle.FromFacing(exitinfo.Facing);
if (exitinfo.Facing < 0)
WAngle initialFacing;
if (!exitinfo.Facing.HasValue)
{
var delta = to - spawn;
if (delta.HorizontalLengthSquared == 0)
@@ -68,6 +68,8 @@ namespace OpenRA.Mods.Common.Traits
else
initialFacing = delta.Yaw;
}
else
initialFacing = exitinfo.Facing.Value;
exitLocations = rp.Value != null && rp.Value.Path.Count > 0 ? rp.Value.Path : new List<CPos> { exit };