Replace IEntityManager resolves in systems for cached EntityManager

This commit is contained in:
Vera Aguilera Puerto
2021-12-08 13:00:43 +01:00
parent 2699540526
commit c8b65be747
98 changed files with 338 additions and 338 deletions

View File

@@ -39,7 +39,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
private void OnExamined(EntityUid uid, GasVolumePumpComponent pump, ExaminedEvent args)
{
if (!IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(pump.Owner).Anchored || !args.IsInDetailsRange) // Not anchored? Out of range? No status.
if (!EntityManager.GetComponent<TransformComponent>(pump.Owner).Anchored || !args.IsInDetailsRange) // Not anchored? Out of range? No status.
return;
if (Loc.TryGetString("gas-volume-pump-system-examined", out var str,
@@ -83,7 +83,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
// Some of the gas from the mixture leaks when overclocked.
if (pump.Overclocked)
{
var tile = _atmosphereSystem.GetTileMixture(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(pump.Owner).Coordinates, true);
var tile = _atmosphereSystem.GetTileMixture(EntityManager.GetComponent<TransformComponent>(pump.Owner).Coordinates, true);
if (tile != null)
{
@@ -97,10 +97,10 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
private void OnPumpInteractHand(EntityUid uid, GasVolumePumpComponent component, InteractHandEvent args)
{
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User, out ActorComponent? actor))
if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
return;
if (IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Anchored)
if (EntityManager.GetComponent<TransformComponent>(component.Owner).Anchored)
{
_userInterfaceSystem.TryOpen(uid, GasVolumePumpUiKey.Key, actor.PlayerSession);
DirtyUI(uid, component);
@@ -132,7 +132,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
return;
_userInterfaceSystem.TrySetUiState(uid, GasVolumePumpUiKey.Key,
new GasVolumePumpBoundUserInterfaceState(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(pump.Owner).EntityName, pump.TransferRate, pump.Enabled));
new GasVolumePumpBoundUserInterfaceState(EntityManager.GetComponent<MetaDataComponent>(pump.Owner).EntityName, pump.TransferRate, pump.Enabled));
}
}
}