diff --git a/Content.Shared/Cuffs/Components/HandcuffComponent.cs b/Content.Shared/Cuffs/Components/HandcuffComponent.cs index b43bf18bf8..a91692389f 100644 --- a/Content.Shared/Cuffs/Components/HandcuffComponent.cs +++ b/Content.Shared/Cuffs/Components/HandcuffComponent.cs @@ -45,6 +45,13 @@ public sealed partial class HandcuffComponent : Component [DataField, ViewVariables(VVAccess.ReadWrite)] public EntProtoId? BrokenPrototype; + /// + /// Whether or not these cuffs are in the process of being removed. + /// Used simply to prevent spawning multiple . + /// + [DataField] + public bool Removing; + [DataField, ViewVariables(VVAccess.ReadWrite)] public DamageSpecifier DamageOnResist = new() { diff --git a/Content.Shared/Cuffs/SharedCuffableSystem.cs b/Content.Shared/Cuffs/SharedCuffableSystem.cs index 9f41ed3b5e..088323fcc5 100644 --- a/Content.Shared/Cuffs/SharedCuffableSystem.cs +++ b/Content.Shared/Cuffs/SharedCuffableSystem.cs @@ -621,7 +621,7 @@ namespace Content.Shared.Cuffs if (!Resolve(target, ref cuffable) || !Resolve(cuffsToRemove, ref cuff)) return; - if (TerminatingOrDeleted(cuffsToRemove) || TerminatingOrDeleted(target)) + if (cuff.Removing || TerminatingOrDeleted(cuffsToRemove) || TerminatingOrDeleted(target)) return; if (user != null) @@ -632,6 +632,7 @@ namespace Content.Shared.Cuffs return; } + cuff.Removing = true; _audio.PlayPredicted(cuff.EndUncuffSound, target, user); _container.Remove(cuffsToRemove, cuffable.Container); @@ -688,6 +689,7 @@ namespace Content.Shared.Cuffs } } } + cuff.Removing = false; } #region ActionBlocker diff --git a/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml b/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml index f2fbab04a0..2e33ef24a3 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml @@ -52,6 +52,14 @@ - type: Construction graph: makeshifthandcuffs node: cuffscable + - type: Item + inhandVisuals: + left: + - state: inhand-left + color: forestgreen + right: + - state: inhand-right + color: forestgreen - type: Sprite sprite: Objects/Misc/cablecuffs.rsi state: cuff @@ -120,6 +128,14 @@ sprite: Objects/Misc/cablecuffs.rsi state: cuff-broken color: forestgreen + - type: Item + inhandVisuals: + left: + - state: inhand-left + color: forestgreen + right: + - state: inhand-right + color: forestgreen - type: entity parent: Handcuffs