fix idle handling. that was dumb.

This commit is contained in:
Chris Forbes
2010-03-27 10:52:51 +13:00
parent 2f02b5c453
commit 74a5f2e4d4

View File

@@ -65,7 +65,8 @@ namespace OpenRA
public void Tick() public void Tick()
{ {
while (currentActivity != null && !(currentActivity is Idle)) var wasIdle = currentActivity is Idle;
while (currentActivity != null)
{ {
var a = currentActivity; var a = currentActivity;
currentActivity = a.Tick(this) ?? new Idle(); currentActivity = a.Tick(this) ?? new Idle();
@@ -74,8 +75,9 @@ namespace OpenRA
if (currentActivity is Idle) if (currentActivity is Idle)
{ {
foreach (var ni in traits.WithInterface<INotifyIdle>()) if (!wasIdle)
ni.Idle(this); foreach (var ni in traits.WithInterface<INotifyIdle>())
ni.Idle(this);
break; break;
} }