This commit is contained in:
Leon Friedrich
2022-03-17 20:13:31 +13:00
committed by GitHub
parent 7b84362901
commit bfd95c493b
94 changed files with 1454 additions and 2185 deletions

View File

@@ -1,8 +1,8 @@
using Content.Server.Clothing.Components;
using Content.Server.Popups;
using Content.Server.Storage.Components;
using Content.Shared.Acts;
using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Item;
using Robust.Shared.Containers;
using Robust.Shared.Player;
@@ -12,6 +12,7 @@ namespace Content.Server.Storage.EntitySystems
public sealed class SecretStashSystem : EntitySystem
{
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
public override void Initialize()
{
@@ -83,7 +84,7 @@ namespace Content.Server.Storage.EntitySystems
}
// try to move item from hands to stash container
if (!hands.Drop(itemToHideUid, container))
if (!_handsSystem.TryDropIntoContainer(userUid, itemToHideUid, container))
{
return false;
}
@@ -115,13 +116,7 @@ namespace Content.Server.Storage.EntitySystems
return false;
}
// get item inside container
var itemUid = container.ContainedEntity;
if (!EntityManager.TryGetComponent(itemUid, out SharedItemComponent? item))
{
return false;
}
hands.PutInHandOrDrop(item);
_handsSystem.PickupOrDrop(userUid, container.ContainedEntity.Value, handsComp: hands);
// show success message
var successMsg = Loc.GetString("comp-secret-stash-action-get-item-found-something",