diff --git a/OpenRA.Game/Actor.cs b/OpenRA.Game/Actor.cs index 58ba3475d7..e5a6a9386e 100755 --- a/OpenRA.Game/Actor.cs +++ b/OpenRA.Game/Actor.cs @@ -89,10 +89,6 @@ namespace OpenRA public void Tick() { - if (currentActivity == null) - foreach (var ni in TraitsImplementing()) - ni.TickIdle(this); - currentActivity = Util.RunActivity( this, currentActivity ); } diff --git a/OpenRA.Game/World.cs b/OpenRA.Game/World.cs index 3d010f66b0..b35e8c59f5 100644 --- a/OpenRA.Game/World.cs +++ b/OpenRA.Game/World.cs @@ -16,6 +16,7 @@ using OpenRA.FileFormats; using OpenRA.Network; using OpenRA.Orders; using OpenRA.Traits; +using OpenRA.Support; using XRandom = OpenRA.Thirdparty.Random; namespace OpenRA @@ -157,7 +158,15 @@ namespace OpenRA // Todo: Expose this as an order so it can be synced if (!DisableTick) { - actors.Do( x => x.Tick() ); + using( new PerfSample("tick_idle") ) + foreach( var ni in ActorsWithTrait() ) + if (ni.Actor.IsIdle) + ni.Trait.TickIdle(ni.Actor); + + using( new PerfSample("tick_activities") ) + foreach( var a in actors ) + a.Tick(); + ActorsWithTrait().DoTimed( x => { x.Trait.Tick( x.Actor );