Update movement inside leap to show attack animation
This commit is contained in:
@@ -92,6 +92,10 @@ namespace OpenRA.Mods.Cnc.Activities
|
|||||||
// (This does not update the visual position!)
|
// (This does not update the visual position!)
|
||||||
mobile.SetLocation(destinationCell, destinationSubCell, destinationCell, destinationSubCell);
|
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
|
// Revoke the condition before attacking, as it is usually used to pause the attack trait
|
||||||
attack.RevokeLeapCondition(self);
|
attack.RevokeLeapCondition(self);
|
||||||
attack.DoAttack(self, target);
|
attack.DoAttack(self, target);
|
||||||
|
|||||||
@@ -255,6 +255,11 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ITick.Tick(Actor self)
|
void ITick.Tick(Actor self)
|
||||||
|
{
|
||||||
|
UpdateMovement(self);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateMovement(Actor self)
|
||||||
{
|
{
|
||||||
var newMovementTypes = MovementType.None;
|
var newMovementTypes = MovementType.None;
|
||||||
if ((oldPos - CenterPosition).HorizontalLengthSquared != 0)
|
if ((oldPos - CenterPosition).HorizontalLengthSquared != 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user