Optimize some allocations.

This commit is contained in:
Pieter-Jan Briers
2020-11-11 01:30:09 +01:00
parent 6b3beb3808
commit 5dc15b90c6
3 changed files with 7 additions and 5 deletions
@@ -102,9 +102,9 @@ namespace Robust.Client.GameObjects.EntitySystems
QueueUpdateLight(light);
}
foreach (var child in entity.Transform.Children)
foreach (var child in entity.Transform.ChildEntityUids)
{
UpdateEntity(child.Owner);
UpdateEntity(EntityManager.GetEntity(child));
}
}
@@ -131,7 +131,7 @@ namespace Robust.Client.GameObjects.EntitySystems
newMapTrees?.SpriteTree.AddOrUpdate(sprite);
}
if (ev.Entity.TryGetComponent(out PointLightComponent? light))
{
oldMapTrees?.LightTree.Remove(light);