Stack and storage enhancements (#16405)
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
using Content.Server.Storage.Components;
|
||||
using Content.Server.Storage.EntitySystems;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Stacks;
|
||||
using Content.Shared.Verbs;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.Containers;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
@@ -14,6 +17,8 @@ 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 };
|
||||
@@ -160,6 +165,12 @@ namespace Content.Server.Stack
|
||||
if (Split(uid, amount, userTransform.Coordinates, stack) is not {} split)
|
||||
return;
|
||||
|
||||
if (_container.TryGetContainingContainer(uid, out var container) &&
|
||||
TryComp<ServerStorageComponent>(container.Owner, out var storage))
|
||||
{
|
||||
_storage.UpdateStorageUI(container.Owner, storage);
|
||||
}
|
||||
|
||||
HandsSystem.PickupOrDrop(userUid, split);
|
||||
|
||||
PopupSystem.PopupCursor(Loc.GetString("comp-stack-split"), userUid);
|
||||
|
||||
Reference in New Issue
Block a user