Storage CanInsert() tweaks (#21623)

This commit is contained in:
Leon Friedrich
2023-11-13 23:43:03 +11:00
committed by GitHub
parent dc5739a6c3
commit eb0c86f803
8 changed files with 142 additions and 162 deletions

View File

@@ -1,10 +1,7 @@
using Content.Server.Storage.EntitySystems;
using Content.Shared.Popups;
using Content.Shared.Stacks;
using Content.Shared.Storage;
using Content.Shared.Verbs;
using JetBrains.Annotations;
using Robust.Server.Containers;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
@@ -17,8 +14,6 @@ namespace Content.Server.Stack
[UsedImplicitly]
public sealed class StackSystem : SharedStackSystem
{
[Dependency] private readonly ContainerSystem _container = default!;
[Dependency] private readonly StorageSystem _storage = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
public static readonly int[] DefaultSplitAmounts = { 1, 5, 10, 20, 30, 50 };
@@ -165,12 +160,6 @@ namespace Content.Server.Stack
if (Split(uid, amount, userTransform.Coordinates, stack) is not {} split)
return;
if (_container.TryGetContainingContainer(uid, out var container) &&
TryComp<StorageComponent>(container.Owner, out var storage))
{
_storage.UpdateUI(container.Owner, storage);
}
Hands.PickupOrDrop(userUid, split);
Popup.PopupCursor(Loc.GetString("comp-stack-split"), userUid);