Skip to content

Commit

Permalink
WithIdleOverlay: support animation with facings
Browse files Browse the repository at this point in the history
  • Loading branch information
dnqbob authored and PunkPun committed May 3, 2024
1 parent 670067a commit 64f35fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion OpenRA.Mods.Common/Traits/Render/WithIdleOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ public WithIdleOverlay(Actor self, WithIdleOverlayInfo info)
{
var rs = self.Trait<RenderSprites>();
var body = self.Trait<BodyOrientation>();
var facing = self.TraitOrDefault<IFacing>();

var image = info.Image ?? rs.GetImage(self);
overlay = new Animation(self.World, image, () => IsTraitPaused)
overlay = new Animation(self.World, image, facing == null ? () => WAngle.Zero : (body == null ? () => facing.Facing : () => body.QuantizeFacing(facing.Facing)), () => IsTraitPaused)
{
IsDecoration = info.IsDecoration
};
Expand Down

0 comments on commit 64f35fe

Please sign in to comment.