Convert Aircraft.Facing to WAngle.

This commit is contained in:
Paul Chote
2020-05-30 22:39:50 +01:00
committed by reaperrr
parent 7a78c37851
commit 6d6b21a0eb
11 changed files with 80 additions and 48 deletions

View File

@@ -54,7 +54,9 @@ namespace OpenRA.Mods.Common.Activities
if (info.MaximumSpinSpeed < 0 || Math.Abs(spin) < info.MaximumSpinSpeed)
spin += acceleration; // TODO: Possibly unhardcode this
aircraft.Facing = (aircraft.Facing + spin) % 256;
// Allow for negative spin values and convert from facing to angle units
// TODO: Remember to convert this when removing WAngle.FromFacing
aircraft.Facing = new WAngle(aircraft.Facing.Angle + 4 * spin);
}
var move = info.Moves ? aircraft.FlyStep(aircraft.Facing) : WVec.Zero;