Defer running the contents of TraitEnabled in WithMoveAnimation

This commit is contained in:
abcdefg30
2019-06-05 17:16:25 +02:00
committed by reaperrr
parent 1aa80f9c11
commit 586fa80943

View File

@@ -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)