mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-02-15 04:30:57 +01:00
Revert "It's no longer possible to unbuckle if you are handcuffed" (#17717)
This reverts commit 6d31d50b43.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user