From 74a5f2e4d49b06cf9dc02aea08092873ba72a57f Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 27 Mar 2010 10:52:51 +1300 Subject: [PATCH] fix idle handling. that was dumb. --- OpenRA.Game/Actor.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OpenRA.Game/Actor.cs b/OpenRA.Game/Actor.cs index 458111700d..1ae7e77370 100755 --- a/OpenRA.Game/Actor.cs +++ b/OpenRA.Game/Actor.cs @@ -65,7 +65,8 @@ namespace OpenRA public void Tick() { - while (currentActivity != null && !(currentActivity is Idle)) + var wasIdle = currentActivity is Idle; + while (currentActivity != null) { var a = currentActivity; currentActivity = a.Tick(this) ?? new Idle(); @@ -74,8 +75,9 @@ namespace OpenRA if (currentActivity is Idle) { - foreach (var ni in traits.WithInterface()) - ni.Idle(this); + if (!wasIdle) + foreach (var ni in traits.WithInterface()) + ni.Idle(this); break; }