From 586fa809431223538971e2c98fae77eb06b6e7c6 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Wed, 5 Jun 2019 17:16:25 +0200 Subject: [PATCH] Defer running the contents of TraitEnabled in WithMoveAnimation --- OpenRA.Mods.Common/Traits/Render/WithMoveAnimation.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/Render/WithMoveAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithMoveAnimation.cs index 464d4386f1..44a6d39698 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithMoveAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithMoveAnimation.cs @@ -73,7 +73,8 @@ namespace OpenRA.Mods.Common.Traits.Render protected override void TraitEnabled(Actor self) { - UpdateAnimation(self, movement.CurrentMovementTypes); + // HACK: Use a FrameEndTask to avoid construction order issues with WithSpriteBody + self.World.AddFrameEndTask(w => UpdateAnimation(self, movement.CurrentMovementTypes)); } protected override void TraitDisabled(Actor self)