This commit is contained in:
Chris Forbes
2009-11-09 22:56:29 +13:00
parent 7534492526
commit cfd99b5250
2 changed files with 11 additions and 0 deletions

View File

@@ -93,5 +93,7 @@ namespace OpenRa.Game.Traits
if (move == null || move.path == null) return new int2[] { }; if (move == null || move.path == null) return new int2[] { };
return Enumerable.Reverse(move.path); return Enumerable.Reverse(move.path);
} }
public bool HasActivity { get { return currentActivity != null; } }
} }
} }

View File

@@ -41,6 +41,15 @@ namespace OpenRa.Game.Traits
rotorAnim.Tick(); rotorAnim.Tick();
if (secondRotorAnim != null) if (secondRotorAnim != null)
secondRotorAnim.Tick(); secondRotorAnim.Tick();
var mobile = self.traits.Get<Mobile>();
var isFlying = mobile.HasActivity;
if (isFlying ^ (rotorAnim.CurrentSequence.Name != "rotor"))
return;
rotorAnim.PlayRepeatingPreservingPosition(isFlying ? "rotor" : "slow-rotor");
if (secondRotorAnim != null)
secondRotorAnim.PlayRepeatingPreservingPosition(isFlying ? "rotor2" : "slow-rotor2");
} }
} }
} }