using StatelessTraitInfo<> for some things

This commit is contained in:
Chris Forbes
2010-01-10 14:15:45 +13:00
parent 79ce6b70b6
commit be9fd1e277
18 changed files with 20 additions and 89 deletions

View File

@@ -11,8 +11,6 @@ namespace OpenRa.Game.Traits
class RenderUnitTurreted : RenderUnit
{
public Animation muzzleFlash;
public RenderUnitTurreted(Actor self)
: base(self)
{
@@ -37,7 +35,7 @@ namespace OpenRa.Game.Traits
if( self.Info.MuzzleFlash )
{
muzzleFlash = new Animation( self.Info.Name );
var muzzleFlash = new Animation( self.Info.Name );
muzzleFlash.PlayFetchIndex( "muzzle",
() => ( Util.QuantizeFacing( self.traits.Get<Turreted>().turretFacing, 8 ) ) * 6
+ (int)( attack.primaryRecoil * 5.9f ) ); /* hack: recoil can be 1.0f, but don't overflow into next anim */