Fix incorrect animation playing when moving infantry stop to attack.

This commit is contained in:
Paul Chote
2020-12-10 11:30:40 +00:00
committed by reaperrr
parent ed94f7680a
commit 4c01c772f8

View File

@@ -148,7 +148,12 @@ namespace OpenRA.Mods.Common.Traits.Render
void INotifyAttack.PreparingAttack(Actor self, in Target target, Armament a, Barrel barrel)
{
Attacking(self, target, a);
// Lambdas can't use 'in' variables, so capture a copy for later
var attackTarget = target;
// HACK: The FrameEndTask makes sure that this runs after Tick(), preventing that from
// overriding the animation when an infantry unit stops to attack
self.World.AddFrameEndTask(_ => Attacking(self, attackTarget, a));
}
void INotifyAttack.Attacking(Actor self, in Target target, Armament a, Barrel barrel) { }