Convert turret facings to WAngle relative to the body.

This commit is contained in:
Paul Chote
2020-07-18 12:41:22 +01:00
committed by reaperrr
parent 70a86bed7a
commit 75cb5c2166
15 changed files with 189 additions and 192 deletions

View File

@@ -68,7 +68,7 @@ namespace OpenRA.Mods.Common.Traits
// TODO: Carry orientation over from the parent instead of just facing
var dynamicFacingInit = init.GetOrDefault<DynamicFacingInit>();
var bodyFacing = dynamicFacingInit != null ? dynamicFacingInit.Value() : init.GetValue<FacingInit, WAngle>(WAngle.Zero);
facing = Turreted.TurretFacingFromInit(init, info, WAngle.Zero)();
facing = TurretedInfo.WorldFacingFromInit(init, info, WAngle.Zero)();
// Calculate final position
var throwRotation = WRot.FromYaw(new WAngle(Game.CosmeticRandom.Next(1024)));