Fix salvage gib attempt 2 (#9444)

This commit is contained in:
wrexbe 2022-07-05 09:24:29 -07:00 committed by GitHub
parent 4766638413
commit f9589f82cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -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);