Skip to content

Commit 611fbf1

Browse files
authored
use tracker for getting glow controllers
1 parent 5bb85ba commit 611fbf1

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/Entities/Misc/GlowController.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,10 @@ private static void IL_EntityList_UpdateLists(ILContext il)
6262

6363
cursor.Emit(OpCodes.Ldarg_0);
6464
cursor.EmitDelegate<Func<EntityList, GlowController[]>>(entityList =>
65-
{
66-
// not sure whether the tracker will work here so doing this just in case
67-
IEnumerable<Entity> allEntities = entityList.Concat(entityList.ToAdd);
68-
return allEntities.Where(entity => entity is GlowController)
69-
.Cast<GlowController>()
70-
.ToArray();
71-
});
65+
entityList.Scene.Tracker.GetEntities<GlowController>()
66+
.Cast<GlowController>()
67+
.ToArray()
68+
);
7269
cursor.Emit(OpCodes.Stloc, allGlowControllers);
7370

7471
if (!cursor.TryGotoNextBestFit(MoveType.After,

0 commit comments

Comments
 (0)