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

@@ -79,7 +79,7 @@ namespace Content.Server.Buckle.Systems
return;
}
var strapPosition = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(strap.Owner).Coordinates.Offset(buckle.BuckleOffset);
var strapPosition = EntityManager.GetComponent<TransformComponent>(strap.Owner).Coordinates.Offset(buckle.BuckleOffset);
if (ev.NewPosition.InRange(EntityManager, strapPosition, 0.2f))
{
@@ -95,7 +95,7 @@ namespace Content.Server.Buckle.Systems
// This fixes buckle offsets and draw depths.
foreach (var buckledEntity in strap.BuckledEntities)
{
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(buckledEntity, out BuckleComponent? buckled))
if (!EntityManager.TryGetComponent(buckledEntity, out BuckleComponent? buckled))
{
continue;
}
@@ -112,7 +112,7 @@ namespace Content.Server.Buckle.Systems
{
foreach (var buckledEntity in strap.BuckledEntities)
{
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(buckledEntity, out BuckleComponent? buckled))
if (!EntityManager.TryGetComponent(buckledEntity, out BuckleComponent? buckled))
{
continue;
}