hands ECS (#7081)
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user