Fix for handcuffing someone more than once (#33646)

* Fix for over-cuffing someone

* comment
This commit is contained in:
Plykiya
2024-11-30 07:58:56 -08:00
committed by GitHub
parent 86791583f9
commit 021c9832ef

View File

@@ -461,6 +461,12 @@ namespace Content.Shared.Cuffs
if (!_interaction.InRangeUnobstructed(handcuff, target))
return false;
// if the amount of hands the target has is equal to or less than the amount of hands that are cuffed
// don't apply the new set of cuffs
// (how would you even end up with more cuffed hands than actual hands? either way accounting for it)
if (TryComp<HandsComponent>(target, out var hands) && hands.Count <= component.CuffedHandCount)
return false;
// Success!
_hands.TryDrop(user, handcuff);