Remove 700 usages of Component.Owner (#21100)

This commit is contained in:
DrSmugleaf
2023-10-19 12:34:31 -07:00
committed by GitHub
parent 5825ffb95c
commit f560f88eb5
261 changed files with 2291 additions and 2036 deletions

View File

@@ -38,12 +38,16 @@ public sealed class CardboardBoxSystem : SharedCardboardBoxSystem
var mover = GetEntity(msg.Mover);
//Filter out entities in range to see that they're a mob and add them to the mobMoverEntities hash for faster lookup
foreach (var moverComp in _entityLookup.GetComponentsInRange<MobMoverComponent>(xform.Coordinates, box.Distance))
var movers = new HashSet<Entity<MobMoverComponent>>();
_entityLookup.GetEntitiesInRange(xform.Coordinates, box.Distance, movers);
foreach (var moverComp in movers)
{
if (moverComp.Owner == mover)
var uid = moverComp.Owner;
if (uid == mover)
continue;
mobMoverEntities.Add(moverComp.Owner);
mobMoverEntities.Add(uid);
}
//Play the effect for the mobs as long as they can see the box and are in range.