@@ -1,6 +1,10 @@
|
||||
using Content.Server.Contests;
|
||||
using Content.Server.Popups;
|
||||
using Content.Server.Storage.Components;
|
||||
using Content.Server.Carrying;
|
||||
using Content.Shared.Storage;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.Hands.EntitySystems;
|
||||
@@ -21,6 +25,7 @@ public sealed class EscapeInventorySystem : EntitySystem
|
||||
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||
[Dependency] private readonly ContestsSystem _contests = default!;
|
||||
[Dependency] private readonly CarryingSystem _carryingSystem = default!;
|
||||
|
||||
/// <summary>
|
||||
/// You can't escape the hands of an entity this many times more massive than you.
|
||||
@@ -64,7 +69,7 @@ public sealed class EscapeInventorySystem : EntitySystem
|
||||
AttemptEscape(uid, container.Owner, component);
|
||||
}
|
||||
|
||||
private void AttemptEscape(EntityUid user, EntityUid container, CanEscapeInventoryComponent component, float multiplier = 1f)
|
||||
public void AttemptEscape(EntityUid user, EntityUid container, CanEscapeInventoryComponent component, float multiplier = 1f)
|
||||
{
|
||||
if (component.IsEscaping)
|
||||
return;
|
||||
@@ -93,7 +98,14 @@ public sealed class EscapeInventorySystem : EntitySystem
|
||||
if (args.Handled || args.Cancelled)
|
||||
return;
|
||||
|
||||
if (TryComp<BeingCarriedComponent>(uid, out var carried))
|
||||
{
|
||||
_carryingSystem.DropCarried(carried.Carrier, uid);
|
||||
return;
|
||||
}
|
||||
|
||||
_containerSystem.AttachParentToContainerOrGrid((uid, Transform(uid)));
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user