Update GetComponents for IEnumerable (#18395)
This commit is contained in:
@@ -33,9 +33,8 @@ namespace Content.Server.Administration.Commands
|
||||
|
||||
var i = 0;
|
||||
|
||||
foreach (var component in components)
|
||||
foreach (var (uid, component) in components)
|
||||
{
|
||||
var uid = component.Owner;
|
||||
entityManager.RemoveComponent(uid, component);
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Content.Server.Administration.Commands
|
||||
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
var entitiesWithComponents = components.Select(c => entityManager.GetAllComponents(c).Select(x => x.Owner));
|
||||
var entitiesWithComponents = components.Select(c => entityManager.GetAllComponents(c).Select(x => x.Uid));
|
||||
var entitiesWithAllComponents = entitiesWithComponents.Skip(1).Aggregate(new HashSet<EntityUid>(entitiesWithComponents.First()), (h, e) => { h.IntersectWith(e); return h; });
|
||||
|
||||
var count = 0;
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Content.Server.Administration.Commands
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
var entityIds = new HashSet<string>();
|
||||
|
||||
var entitiesWithComponents = components.Select(c => entityManager.GetAllComponents(c).Select(x => x.Owner)).ToArray();
|
||||
var entitiesWithComponents = components.Select(c => entityManager.GetAllComponents(c).Select(x => x.Uid)).ToArray();
|
||||
var entitiesWithAllComponents = entitiesWithComponents.Skip(1).Aggregate(new HashSet<EntityUid>(entitiesWithComponents.First()), (h, e) => { h.IntersectWith(e); return h; });
|
||||
|
||||
foreach (var entity in entitiesWithAllComponents)
|
||||
|
||||
Reference in New Issue
Block a user