Patch 1.9 (#39)

* Возьми ее на руки и скажи...

* tweaks
This commit is contained in:
rhailrake
2023-05-10 01:11:06 +06:00
committed by Aviu00
parent 26c6290be0
commit 2f055d1aed
27 changed files with 495 additions and 40 deletions

View File

@@ -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;
}