Convert (Dynamic)FacingInit, (Dynamic)TurretFacingInit to WAngle.
This commit is contained in:
@@ -141,8 +141,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (info.DeliveryAircraft != null)
|
||||
{
|
||||
var crate = w.CreateActor(false, crateActor, new TypeDictionary { new OwnerInit(w.WorldActor.Owner) });
|
||||
var dropFacing = 256 * self.World.SharedRandom.Next(info.QuantizedFacings) / info.QuantizedFacings;
|
||||
var delta = new WVec(0, -1024, 0).Rotate(WRot.FromFacing(dropFacing));
|
||||
var dropFacing = WAngle.FromFacing(256 * self.World.SharedRandom.Next(info.QuantizedFacings) / info.QuantizedFacings);
|
||||
var delta = new WVec(0, -1024, 0).Rotate(WRot.FromYaw(dropFacing));
|
||||
|
||||
var altitude = self.World.Map.Rules.Actors[info.DeliveryAircraft].TraitInfo<AircraftInfo>().CruiseAltitude.Length;
|
||||
var target = self.World.Map.CenterOfCell(p) + new WVec(0, 0, altitude);
|
||||
|
||||
@@ -194,10 +194,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
|
||||
if (actor.HasTraitInfo<IFacingInfo>())
|
||||
reference.Add(new FacingInit(info.PreviewFacing));
|
||||
|
||||
if (actor.HasTraitInfo<TurretedInfo>())
|
||||
reference.Add(new TurretFacingInit(info.PreviewFacing));
|
||||
reference.Add(new FacingInit(WAngle.FromFacing(info.PreviewFacing)));
|
||||
|
||||
Type = EditorCursorType.Actor;
|
||||
Actor = new EditorActorPreview(wr, null, reference, owner);
|
||||
|
||||
@@ -85,12 +85,13 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
if (unitGroup.BaseActor != null)
|
||||
{
|
||||
var facing = unitGroup.BaseActorFacing < 0 ? new WAngle(w.SharedRandom.Next(1024)) : WAngle.FromFacing(unitGroup.BaseActorFacing);
|
||||
w.CreateActor(unitGroup.BaseActor.ToLowerInvariant(), new TypeDictionary
|
||||
{
|
||||
new LocationInit(sp + unitGroup.BaseActorOffset),
|
||||
new OwnerInit(p),
|
||||
new SkipMakeAnimsInit(),
|
||||
new FacingInit(unitGroup.BaseActorFacing < 0 ? w.SharedRandom.Next(256) : unitGroup.BaseActorFacing),
|
||||
new FacingInit(facing),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -112,13 +113,14 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
|
||||
var subCell = ip.SharesCell ? w.ActorMap.FreeSubCell(validCell) : 0;
|
||||
var facing = unitGroup.SupportActorsFacing < 0 ? new WAngle(w.SharedRandom.Next(1024)) : WAngle.FromFacing(unitGroup.SupportActorsFacing);
|
||||
|
||||
w.CreateActor(s.ToLowerInvariant(), new TypeDictionary
|
||||
{
|
||||
new OwnerInit(p),
|
||||
new LocationInit(validCell),
|
||||
new SubCellInit(subCell),
|
||||
new FacingInit(unitGroup.SupportActorsFacing < 0 ? w.SharedRandom.Next(256) : unitGroup.SupportActorsFacing)
|
||||
new FacingInit(facing),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user