Even more resolve removals.

This commit is contained in:
Vera Aguilera Puerto
2021-12-08 17:32:32 +01:00
parent 684cb76173
commit cdc8336695
61 changed files with 364 additions and 278 deletions

View File

@@ -41,11 +41,12 @@ namespace Content.Server.Physics.Controllers
}
var direction = system.GetAngle(comp).ToVec();
var ownerPos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(comp.Owner).WorldPosition;
var entMan = IoCManager.Resolve<IEntityManager>();
var ownerPos = entMan.GetComponent<TransformComponent>(comp.Owner).WorldPosition;
foreach (var (entity, physics) in EntitySystem.Get<ConveyorSystem>().GetEntitiesToMove(comp))
{
var itemRelativeToConveyor = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).WorldPosition - ownerPos;
var itemRelativeToConveyor = entMan.GetComponent<TransformComponent>(entity).WorldPosition - ownerPos;
physics.LinearVelocity += Convey(direction, comp.Speed, frameTime, itemRelativeToConveyor);
}
}

View File

@@ -270,7 +270,7 @@ namespace Content.Server.Physics.Controllers
{
if (!mover.Owner.HasTag("FootstepSound")) return;
var transform = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(mover.Owner);
var transform = EntityManager.GetComponent<TransformComponent>(mover.Owner);
var coordinates = transform.Coordinates;
var gridId = coordinates.GetGridId(EntityManager);
var distanceNeeded = mover.Sprinting ? StepSoundMoveDistanceRunning : StepSoundMoveDistanceWalking;
@@ -302,9 +302,9 @@ namespace Content.Server.Physics.Controllers
mobMover.StepSoundDistance -= distanceNeeded;
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<InventoryComponent?>(mover.Owner, out var inventory)
if (EntityManager.TryGetComponent<InventoryComponent?>(mover.Owner, out var inventory)
&& inventory.TryGetSlotItem<ItemComponent>(EquipmentSlotDefines.Slots.SHOES, out var item)
&& IoCManager.Resolve<IEntityManager>().TryGetComponent<FootstepModifierComponent?>(item.Owner, out var modifier))
&& EntityManager.TryGetComponent<FootstepModifierComponent?>(item.Owner, out var modifier))
{
modifier.PlayFootstep();
}
@@ -351,7 +351,7 @@ namespace Content.Server.Physics.Controllers
SoundSystem.Play(
Filter.Pvs(coordinates),
soundToPlay,
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(mover).Coordinates,
EntityManager.GetComponent<TransformComponent>(mover).Coordinates,
sprinting ? AudioParams.Default.WithVolume(0.75f) : null);
}
}

View File

@@ -21,7 +21,7 @@ namespace Content.Server.Physics.Controllers
foreach (var (singularity, physics) in EntityManager.EntityQuery<ServerSingularityComponent, PhysicsComponent>())
{
if (IoCManager.Resolve<IEntityManager>().HasComponent<ActorComponent>(singularity.Owner) ||
if (EntityManager.HasComponent<ActorComponent>(singularity.Owner) ||
singularity.BeingDeletedByAnotherSingularity) continue;
singularity.MoveAccumulator -= frameTime;