putting that fail in one place.
This commit is contained in:
@@ -20,7 +20,7 @@ namespace OpenRa.Game.Traits
|
||||
() => (Util.QuantizeFacing(unit.Facing, 8)) * 6 + (int)(attack.primaryRecoil * 5.9f));
|
||||
anims.Add( "muzzle", new AnimationWithOffset(
|
||||
muzzleFlash,
|
||||
() => new float2( self.Info.PrimaryOffset.ElementAtOrDefault( 2 ), self.Info.PrimaryOffset.ElementAtOrDefault( 3 ) ),
|
||||
() => self.Info.PrimaryOffset.AbsOffset(),
|
||||
() => attack.primaryRecoil <= 0 ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,10 +110,13 @@ namespace OpenRa.Game.Traits
|
||||
var bodyFacing = unit.Facing;
|
||||
var quantizedFacing = QuantizeFacing(bodyFacing, numDirs) * (256 / numDirs);
|
||||
|
||||
return (RotateVectorByFacing(new float2(offset[0], offset[1]), quantizedFacing, .7f) + GetRecoil(self, recoil))
|
||||
+ new float2(offset.ElementAtOrDefault(2), offset.ElementAtOrDefault(3));
|
||||
return (RotateVectorByFacing(offset.RelOffset(), quantizedFacing, .7f) + GetRecoil(self, recoil))
|
||||
+ offset.AbsOffset();
|
||||
}
|
||||
|
||||
public static float2 RelOffset(this int[] offset) { return new float2(offset[0], offset[1]); }
|
||||
public static float2 AbsOffset(this int[] offset) { return new float2(offset.ElementAtOrDefault(2), offset.ElementAtOrDefault(3)); }
|
||||
|
||||
public static Tuple<Sprite, float2, int> Centered(Actor self, Sprite s, float2 location)
|
||||
{
|
||||
var pal = self.Owner == null ? 0 : self.Owner.Palette;
|
||||
|
||||
Reference in New Issue
Block a user