Revert "It's no longer possible to unbuckle if you are handcuffed" (#17717)

This reverts commit 6d31d50b43.
This commit is contained in:
AJCM-git
2023-06-28 16:54:49 -04:00
committed by GitHub
parent 562dd369c8
commit e2823d8006
2 changed files with 0 additions and 19 deletions

View File

@@ -2,25 +2,18 @@ using Content.Shared.Cuffs;
using JetBrains.Annotations;
using Content.Shared.Cuffs.Components;
using Robust.Shared.GameStates;
using Content.Shared.Buckle.Components;
using Content.Shared.Hands.Components;
using Robust.Shared.Network;
using Content.Server.Popups;
namespace Content.Server.Cuffs
{
[UsedImplicitly]
public sealed class CuffableSystem : SharedCuffableSystem
{
[Dependency] private readonly INetManager _netManager = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<HandcuffComponent, ComponentGetState>(OnHandcuffGetState);
SubscribeLocalEvent<CuffableComponent, ComponentGetState>(OnCuffableGetState);
SubscribeLocalEvent<CuffableComponent, BuckleAttemptEvent>(OnBuckleAttemptEvent);
}
private void OnHandcuffGetState(EntityUid uid, HandcuffComponent component, ref ComponentGetState args)
@@ -46,16 +39,5 @@ namespace Content.Server.Cuffs
// the iconstate is formatted as blah-2, blah-4, blah-6, etc.
// the number corresponds to how many hands are cuffed.
}
private void OnBuckleAttemptEvent(EntityUid uid, CuffableComponent component, ref BuckleAttemptEvent args)
{
if (TryComp<HandsComponent>(uid, out var hands) && component.CuffedHandCount == hands.Count)
{
args.Cancelled = true;
var message = Loc.GetString("handcuff-component-cuff-interrupt-buckled-message");
if (_netManager.IsServer)
_popupSystem.PopupEntity(message, uid);
}
}
}
}