Update movement inside leap to show attack animation

This commit is contained in:
Hedog
2019-07-20 14:43:24 +02:00
committed by abcdefg30
parent 2c24a607bc
commit 2a6f2bbe0e
2 changed files with 9 additions and 0 deletions

View File

@@ -92,6 +92,10 @@ namespace OpenRA.Mods.Cnc.Activities
// (This does not update the visual position!)
mobile.SetLocation(destinationCell, destinationSubCell, destinationCell, destinationSubCell);
// Update movement which results in movementType set to MovementType.None.
// This is needed to prevent the move animation from playing.
mobile.UpdateMovement(self);
// Revoke the condition before attacking, as it is usually used to pause the attack trait
attack.RevokeLeapCondition(self);
attack.DoAttack(self, target);

View File

@@ -255,6 +255,11 @@ namespace OpenRA.Mods.Common.Traits
}
void ITick.Tick(Actor self)
{
UpdateMovement(self);
}
public void UpdateMovement(Actor self)
{
var newMovementTypes = MovementType.None;
if ((oldPos - CenterPosition).HorizontalLengthSquared != 0)