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)
|
public virtual HashSet<EntityUid> Gib(bool gibParts = false)
|
||||||
{
|
{
|
||||||
|
var entMgr = IoCManager.Resolve<IEntityManager>();
|
||||||
|
var metaQuery = entMgr.GetEntityQuery<MetaDataComponent>();
|
||||||
var gibs = new HashSet<EntityUid>();
|
var gibs = new HashSet<EntityUid>();
|
||||||
foreach (var part in SlotParts.Keys)
|
foreach (var part in SlotParts.Keys)
|
||||||
{
|
{
|
||||||
|
if (!metaQuery.HasComponent(part.Owner))
|
||||||
|
{
|
||||||
|
SlotParts.Remove(part);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
gibs.Add(part.Owner);
|
gibs.Add(part.Owner);
|
||||||
RemovePart(part);
|
RemovePart(part);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user