Use EntitySystem dependencies in a bunch of systems.

This commit is contained in:
Vera Aguilera Puerto
2021-07-26 12:58:17 +02:00
parent 4e93340fb0
commit 1033d8bbe5
31 changed files with 130 additions and 130 deletions

View File

@@ -18,6 +18,7 @@ using Robust.Server.Player;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Input.Binding;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Map;
using Robust.Shared.Maths;
@@ -29,6 +30,9 @@ namespace Content.Server.Hands
[UsedImplicitly]
internal sealed class HandsSystem : SharedHandsSystem
{
[Dependency] private readonly InteractionSystem _interactionSystem = default!;
[Dependency] private readonly StackSystem _stackSystem = default!;
public override void Initialize()
{
base.Initialize();
@@ -113,12 +117,12 @@ namespace Content.Server.Hands
if (!hands.TryGetActiveHeldEntity(out var throwEnt))
return false;
if (!Get<InteractionSystem>().TryThrowInteraction(hands.Owner, throwEnt))
if (!_interactionSystem.TryThrowInteraction(hands.Owner, throwEnt))
return false;
if (throwEnt.TryGetComponent(out StackComponent? stack) && stack.Count > 1 && stack.ThrowIndividually)
{
var splitStack = Get<StackSystem>().Split(throwEnt.Uid, stack, 1, playerEnt.Transform.Coordinates);
var splitStack = _stackSystem.Split(throwEnt.Uid, stack, 1, playerEnt.Transform.Coordinates);
if (splitStack == null)
return false;