From cfd99b5250038c4c83c1797f3519b2a42b4247bf Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Mon, 9 Nov 2009 22:56:29 +1300 Subject: [PATCH] #87 fixed --- OpenRa.Game/Traits/Mobile.cs | 2 ++ OpenRa.Game/Traits/RenderUnitRotor.cs | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/OpenRa.Game/Traits/Mobile.cs b/OpenRa.Game/Traits/Mobile.cs index 0abdf8cadc..73bfe0103b 100644 --- a/OpenRa.Game/Traits/Mobile.cs +++ b/OpenRa.Game/Traits/Mobile.cs @@ -93,5 +93,7 @@ namespace OpenRa.Game.Traits if (move == null || move.path == null) return new int2[] { }; return Enumerable.Reverse(move.path); } + + public bool HasActivity { get { return currentActivity != null; } } } } diff --git a/OpenRa.Game/Traits/RenderUnitRotor.cs b/OpenRa.Game/Traits/RenderUnitRotor.cs index c20d6cc668..4b446d7d8c 100755 --- a/OpenRa.Game/Traits/RenderUnitRotor.cs +++ b/OpenRa.Game/Traits/RenderUnitRotor.cs @@ -41,6 +41,15 @@ namespace OpenRa.Game.Traits rotorAnim.Tick(); if (secondRotorAnim != null) secondRotorAnim.Tick(); + + var mobile = self.traits.Get(); + 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"); } } }