Fix IDE0039

This commit is contained in:
RoosterDragon
2023-02-19 11:56:54 +00:00
committed by abcdefg30
parent 4b3f7034b2
commit d4135d608e
67 changed files with 498 additions and 505 deletions

View File

@@ -75,18 +75,18 @@ namespace OpenRA.Mods.Common.Traits.Render
{
rs = init.Self.Trait<RenderSprites>();
Func<bool> paused = () => IsTraitPaused &&
bool Paused() => IsTraitPaused &&
DefaultAnimation.CurrentSequence.Name == NormalizeSequence(init.Self, Info.Sequence);
Func<WVec> subtractDAT = null;
if (info.ForceToGround)
subtractDAT = () => new WVec(0, 0, -init.Self.World.Map.DistanceAboveTerrain(init.Self.CenterPosition).Length);
DefaultAnimation = new Animation(init.World, rs.GetImage(init.Self), baseFacing, paused);
DefaultAnimation = new Animation(init.World, rs.GetImage(init.Self), baseFacing, Paused);
rs.Add(new AnimationWithOffset(DefaultAnimation, subtractDAT, () => IsTraitDisabled), info.Palette, info.IsPlayerPalette);
// Cache the bounds from the default sequence to avoid flickering when the animation changes
boundsAnimation = new Animation(init.World, rs.GetImage(init.Self), baseFacing, paused);
boundsAnimation = new Animation(init.World, rs.GetImage(init.Self), baseFacing, Paused);
boundsAnimation.PlayRepeating(info.Sequence);
}