Fix salvage gib attempt 2 (#9444)
This commit is contained in:
@@ -390,9 +390,16 @@ namespace Content.Shared.Body.Components
|
||||
|
||||
public virtual HashSet<EntityUid> Gib(bool gibParts = false)
|
||||
{
|
||||
var entMgr = IoCManager.Resolve<IEntityManager>();
|
||||
var metaQuery = entMgr.GetEntityQuery<MetaDataComponent>();
|
||||
var gibs = new HashSet<EntityUid>();
|
||||
foreach (var part in SlotParts.Keys)
|
||||
{
|
||||
if (!metaQuery.HasComponent(part.Owner))
|
||||
{
|
||||
SlotParts.Remove(part);
|
||||
continue;
|
||||
}
|
||||
gibs.Add(part.Owner);
|
||||
RemovePart(part);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user