Files
tbd-station-14/Content.Client/Interactable/InteractionSystem.cs
Vera Aguilera Puerto 5cd42c9ad6 Inline UID
2021-12-03 15:53:09 +01:00

26 lines
833 B
C#

using Content.Client.Storage;
using Content.Shared.Interaction;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
namespace Content.Client.Interactable
{
public sealed class InteractionSystem : SharedInteractionSystem
{
public override bool CanAccessViaStorage(EntityUid user, EntityUid target)
{
if (!EntityManager.TryGetEntity(target, out var entity))
return false;
if (!entity.TryGetContainer(out var container))
return false;
if (!EntityManager.TryGetComponent(container.Owner, out ClientStorageComponent storage))
return false;
// we don't check if the user can access the storage entity itself. This should be handed by the UI system.
return storage.UIOpen;
}
}
}