Run TickIdle from inside Actor.Tick instead of World.Tick

Avoids calling ActorsWithTrait<INotifyIdle> every tick and allows caching all INotifyIdle traits at creation.
This commit is contained in:
reaperrr
2018-10-01 19:39:01 +02:00
committed by abcdefg30
parent cf4dc42c8f
commit 422ba16ed9
2 changed files with 6 additions and 6 deletions

View File

@@ -355,12 +355,7 @@ namespace OpenRA
{
WorldTick++;
using (new PerfSample("tick_idle"))
foreach (var ni in ActorsWithTrait<INotifyIdle>())
if (ni.Actor.IsIdle)
ni.Trait.TickIdle(ni.Actor);
using (new PerfSample("tick_activities"))
using (new PerfSample("tick_actors"))
foreach (var a in actors.Values)
a.Tick();