Remove 700 usages of Component.Owner (#21100)
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
using System.Linq;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Station.Components;
|
||||
using Content.Server.Station.Systems;
|
||||
using Content.Shared.Administration;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Console;
|
||||
@@ -42,14 +40,14 @@ namespace Content.Server.Nuke.Commands
|
||||
return CompletionResult.Empty;
|
||||
}
|
||||
|
||||
var stations = _entityManager
|
||||
.EntityQuery<StationDataComponent>()
|
||||
.Select(stationData =>
|
||||
{
|
||||
var meta = _entityManager.GetComponent<MetaDataComponent>(stationData.Owner);
|
||||
var stations = new List<CompletionOption>();
|
||||
var query = _entityManager.EntityQueryEnumerator<StationDataComponent>();
|
||||
while (query.MoveNext(out var uid, out var stationData))
|
||||
{
|
||||
var meta = _entityManager.GetComponent<MetaDataComponent>(uid);
|
||||
|
||||
return new CompletionOption(stationData.Owner.ToString(), meta.EntityName);
|
||||
});
|
||||
stations.Add(new CompletionOption(uid.ToString(), meta.EntityName));
|
||||
}
|
||||
|
||||
return CompletionResult.FromHintOptions(stations, null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user