Kill ContainerHelpers (#20908)
This commit is contained in:
@@ -15,6 +15,7 @@ namespace Content.Client.Commands
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
var containerSys = entityManager.System<SharedContainerSystem>();
|
||||
var organs = entityManager.EntityQuery<OrganComponent>(true);
|
||||
|
||||
foreach (var part in organs)
|
||||
@@ -27,7 +28,7 @@ namespace Content.Client.Commands
|
||||
sprite.ContainerOccluded = false;
|
||||
|
||||
var tempParent = part.Owner;
|
||||
while (tempParent.TryGetContainer(out var container))
|
||||
while (containerSys.TryGetContainingContainer(tempParent, out var container))
|
||||
{
|
||||
if (!container.ShowContents)
|
||||
{
|
||||
|
||||
@@ -174,8 +174,9 @@ namespace Content.Client.Instruments.UI
|
||||
if (localPlayer.ControlledEntity == instrumentEnt)
|
||||
return true;
|
||||
|
||||
var container = _owner.Entities.System<SharedContainerSystem>();
|
||||
// If we're a handheld instrument, we might be in a container. Get it just in case.
|
||||
instrumentEnt.TryGetContainerMan(out var conMan);
|
||||
container.TryGetContainingContainer(instrumentEnt, out var conMan);
|
||||
|
||||
// If the instrument is handheld and we're not holding it, we return.
|
||||
if ((instrument.Handheld && (conMan == null || conMan.Owner != localPlayer.ControlledEntity)))
|
||||
|
||||
@@ -6,15 +6,17 @@ namespace Content.Client.Interactable
|
||||
{
|
||||
public sealed class InteractionSystem : SharedInteractionSystem
|
||||
{
|
||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||
|
||||
public override bool CanAccessViaStorage(EntityUid user, EntityUid target)
|
||||
{
|
||||
if (!EntityManager.EntityExists(target))
|
||||
return false;
|
||||
|
||||
if (!target.TryGetContainer(out var container))
|
||||
if (!_container.TryGetContainingContainer(target, out var container))
|
||||
return false;
|
||||
|
||||
if (!TryComp(container.Owner, out StorageComponent? storage))
|
||||
if (!HasComp<StorageComponent>(container.Owner))
|
||||
return false;
|
||||
|
||||
// we don't check if the user can access the storage entity itself. This should be handed by the UI system.
|
||||
|
||||
Reference in New Issue
Block a user