Convert IFacing.Facing and TurnSpeed to WAngle.
This commit is contained in:
@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
{
|
||||
BodyOrientation body;
|
||||
IFacing facing;
|
||||
int cachedFacing;
|
||||
WAngle cachedFacing;
|
||||
int cachedInterval;
|
||||
|
||||
public LeavesTrails(Actor self, LeavesTrailsInfo info)
|
||||
@@ -81,7 +81,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
{
|
||||
body = self.Trait<BodyOrientation>();
|
||||
facing = self.TraitOrDefault<IFacing>();
|
||||
cachedFacing = facing != null ? facing.Facing : 0;
|
||||
cachedFacing = facing != null ? facing.Facing : WAngle.Zero;
|
||||
cachedPosition = self.CenterPosition;
|
||||
|
||||
base.Created(self);
|
||||
@@ -125,14 +125,14 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
var pos = Info.Type == TrailType.CenterPosition ? spawnPosition + body.LocalToWorld(offsetRotation) :
|
||||
self.World.Map.CenterOfCell(spawnCell);
|
||||
|
||||
var spawnFacing = Info.SpawnAtLastPosition ? cachedFacing : (facing != null ? facing.Facing : 0);
|
||||
var spawnFacing = Info.SpawnAtLastPosition ? cachedFacing : (facing != null ? facing.Facing : WAngle.Zero);
|
||||
|
||||
if ((Info.TerrainTypes.Count == 0 || Info.TerrainTypes.Contains(type)) && !string.IsNullOrEmpty(Info.Image))
|
||||
self.World.AddFrameEndTask(w => w.Add(new SpriteEffect(pos, self.World, Info.Image,
|
||||
Info.Sequences.Random(Game.CosmeticRandom), Info.Palette, Info.VisibleThroughFog, spawnFacing)));
|
||||
self.World.AddFrameEndTask(w => w.Add(new SpriteEffect(pos, spawnFacing, self.World, Info.Image,
|
||||
Info.Sequences.Random(Game.CosmeticRandom), Info.Palette, Info.VisibleThroughFog)));
|
||||
|
||||
cachedPosition = self.CenterPosition;
|
||||
cachedFacing = facing != null ? facing.Facing : 0;
|
||||
cachedFacing = facing != null ? facing.Facing : WAngle.Zero;
|
||||
ticks = 0;
|
||||
|
||||
cachedInterval = isMoving ? Info.MovingInterval : Info.StationaryInterval;
|
||||
|
||||
Reference in New Issue
Block a user