Replace IEntityManager resolves in systems for cached EntityManager
This commit is contained in:
@@ -57,10 +57,10 @@ namespace Content.Server.Engineering.EntitySystems
|
||||
return;
|
||||
}
|
||||
|
||||
if (component.Deleted || (!IoCManager.Resolve<IEntityManager>().EntityExists(component.Owner) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner).EntityLifeStage) >= EntityLifeStage.Deleted)
|
||||
if (component.Deleted || (!EntityManager.EntityExists(component.Owner) ? EntityLifeStage.Deleted : EntityManager.GetComponent<MetaDataComponent>(component.Owner).EntityLifeStage) >= EntityLifeStage.Deleted)
|
||||
return;
|
||||
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<SharedStackComponent?>(component.Owner, out var stackComp)
|
||||
if (EntityManager.TryGetComponent<SharedStackComponent?>(component.Owner, out var stackComp)
|
||||
&& component.RemoveOnInteract && !_stackSystem.Use(uid, 1, stackComp))
|
||||
{
|
||||
return;
|
||||
@@ -68,8 +68,8 @@ namespace Content.Server.Engineering.EntitySystems
|
||||
|
||||
EntityManager.SpawnEntity(component.Prototype, args.ClickLocation.SnapToGrid(grid));
|
||||
|
||||
if (component.RemoveOnInteract && stackComp == null && !((!IoCManager.Resolve<IEntityManager>().EntityExists(component.Owner) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner).EntityLifeStage) >= EntityLifeStage.Deleted))
|
||||
IoCManager.Resolve<IEntityManager>().DeleteEntity(component.Owner);
|
||||
if (component.RemoveOnInteract && stackComp == null && !((!EntityManager.EntityExists(component.Owner) ? EntityLifeStage.Deleted : EntityManager.GetComponent<MetaDataComponent>(component.Owner).EntityLifeStage) >= EntityLifeStage.Deleted))
|
||||
EntityManager.DeleteEntity(component.Owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user