diff --git a/OpenRa.Game/Effects/Bullet.cs b/OpenRa.Game/Effects/Bullet.cs index 2857c00515..2998e5d037 100755 --- a/OpenRa.Game/Effects/Bullet.cs +++ b/OpenRa.Game/Effects/Bullet.cs @@ -46,11 +46,12 @@ namespace OpenRa.Effects if (Projectile.Image != null && Projectile.Image != "none") { - anim = new Animation(Projectile.Image); if (Projectile.Rotates) - Traits.Util.PlayFacing(anim, "idle", () => Traits.Util.GetFacing((dest - src).ToFloat2(), 0)); + anim = new Animation(Projectile.Image, () => Traits.Util.GetFacing((dest - src).ToFloat2(), 0)); else - anim.PlayRepeating("idle"); + anim = new Animation(Projectile.Image); + + anim.PlayRepeating("idle"); } } diff --git a/OpenRa.Game/Effects/Missile.cs b/OpenRa.Game/Effects/Missile.cs index b03eb15713..a1cf100bec 100755 --- a/OpenRa.Game/Effects/Missile.cs +++ b/OpenRa.Game/Effects/Missile.cs @@ -35,12 +35,12 @@ namespace OpenRa.Effects if (Projectile.Image != null && Projectile.Image != "none") { - anim = new Animation(Projectile.Image); - if (Projectile.Rotates) - Traits.Util.PlayFacing(anim, "idle", () => Facing); + anim = new Animation(Projectile.Image, () => Facing); else - anim.PlayRepeating("idle"); + anim = new Animation(Projectile.Image); + + anim.PlayRepeating("idle"); } } diff --git a/OpenRa.Game/Traits/Util.cs b/OpenRa.Game/Traits/Util.cs index 2313e3f9e5..82919d89e6 100755 --- a/OpenRa.Game/Traits/Util.cs +++ b/OpenRa.Game/Traits/Util.cs @@ -43,13 +43,6 @@ namespace OpenRa.Traits return highest * 8; } - public static void PlayFacing(this Animation anim, string sequenceName, Func facing) - { - anim.PlayFetchIndex(sequenceName, - () => Traits.Util.QuantizeFacing(facing(), - anim.CurrentSequence.Length)); - } - public static int GetNearestFacing( int facing, int desiredFacing ) { var turn = desiredFacing - facing; @@ -87,7 +80,7 @@ namespace OpenRa.Traits if (rut == null) return float2.Zero; var facing = self.traits.Get().turretFacing; - var quantizedFacing = QuantizeFacing(facing, rut.anim.CurrentSequence.Length) * (256 / rut.anim.CurrentSequence.Length); + var quantizedFacing = QuantizeFacing(facing, rut.anim.CurrentSequence.Facings) * (256 / rut.anim.CurrentSequence.Length); return RotateVectorByFacing(new float2(0, recoil * self.Info.Traits.Get().Recoil), quantizedFacing, .7f); } @@ -107,7 +100,7 @@ namespace OpenRa.Traits if( unit == null ) return int2.Zero; /* things that don't have a rotating base don't need the turrets repositioned */ var ru = self.traits.GetOrDefault(); - var numDirs = (ru != null) ? ru.anim.CurrentSequence.Length : 8; + var numDirs = (ru != null) ? ru.anim.CurrentSequence.Facings : 8; var bodyFacing = unit.Facing; var quantizedFacing = QuantizeFacing(bodyFacing, numDirs) * (256 / numDirs); diff --git a/mods/ra/sequences.xml b/mods/ra/sequences.xml index b8529878dc..f2caadd0e3 100644 --- a/mods/ra/sequences.xml +++ b/mods/ra/sequences.xml @@ -485,7 +485,7 @@ - + @@ -606,7 +606,7 @@ - + @@ -639,7 +639,7 @@ - +