Two small bugfixes (#8285)

This commit is contained in:
Rane
2022-05-19 11:29:02 -04:00
committed by GitHub
parent 870a99e18d
commit 1f47d65c91
2 changed files with 4 additions and 2 deletions

View File

@@ -34,7 +34,6 @@ namespace Content.Server.Hands.Systems
if (TryComp(hand.HeldEntity, out HandVirtualItemComponent? virt) && virt.BlockingEntity == matching) if (TryComp(hand.HeldEntity, out HandVirtualItemComponent? virt) && virt.BlockingEntity == matching)
{ {
Delete(virt, user); Delete(virt, user);
return;
} }
} }
} }

View File

@@ -7,6 +7,7 @@ using Robust.Shared.Player;
using Content.Shared.Storage; using Content.Shared.Storage;
using Content.Shared.Inventory; using Content.Shared.Inventory;
using Content.Shared.Hands.Components; using Content.Shared.Hands.Components;
using Content.Shared.ActionBlocker;
namespace Content.Server.Resist; namespace Content.Server.Resist;
@@ -15,6 +16,7 @@ public sealed class EscapeInventorySystem : EntitySystem
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!; [Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedContainerSystem _containerSystem = default!; [Dependency] private readonly SharedContainerSystem _containerSystem = default!;
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
public override void Initialize() public override void Initialize()
{ {
@@ -35,7 +37,8 @@ public sealed class EscapeInventorySystem : EntitySystem
if (_containerSystem.TryGetContainingContainer(uid, out var container) if (_containerSystem.TryGetContainingContainer(uid, out var container)
&& (HasComp<SharedStorageComponent>(container.Owner) || HasComp<InventoryComponent>(container.Owner) || HasComp<SharedHandsComponent>(container.Owner))) && (HasComp<SharedStorageComponent>(container.Owner) || HasComp<InventoryComponent>(container.Owner) || HasComp<SharedHandsComponent>(container.Owner)))
{ {
AttemptEscape(uid, container.Owner, component); if (_actionBlockerSystem.CanInteract(uid, container.Owner))
AttemptEscape(uid, container.Owner, component);
} }
} }