Use HasMovementType to avoid Enum.HasFlag allocations.

This commit is contained in:
RoosterDragon
2020-10-11 11:49:32 +01:00
committed by abcdefg30
parent 094ccf76b0
commit 2adee1e374
4 changed files with 7 additions and 7 deletions

View File

@@ -168,12 +168,12 @@ namespace OpenRA.Mods.Common.Traits.Render
wasModifying = rsm.IsModifyingSequence;
}
if ((state != AnimationState.Moving || dirty) && move.CurrentMovementTypes.HasFlag(MovementType.Horizontal))
if ((state != AnimationState.Moving || dirty) && move.CurrentMovementTypes.HasMovementType(MovementType.Horizontal))
{
state = AnimationState.Moving;
DefaultAnimation.PlayRepeating(NormalizeInfantrySequence(self, GetDisplayInfo().MoveSequence));
}
else if (((state == AnimationState.Moving || dirty) && !move.CurrentMovementTypes.HasFlag(MovementType.Horizontal))
else if (((state == AnimationState.Moving || dirty) && !move.CurrentMovementTypes.HasMovementType(MovementType.Horizontal))
|| ((state == AnimationState.Idle || state == AnimationState.IdleAnimating) && !self.IsIdle))
PlayStandAnimation(self);