]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix for handcuffing someone more than once (#33646)
authorPlykiya <58439124+Plykiya@users.noreply.github.com>
Sat, 30 Nov 2024 15:58:56 +0000 (07:58 -0800)
committerGitHub <noreply@github.com>
Sat, 30 Nov 2024 15:58:56 +0000 (16:58 +0100)
* Fix for over-cuffing someone

* comment

Content.Shared/Cuffs/SharedCuffableSystem.cs

index 21d09c744cd6ad74348d850181f428d0065c4d87..b323dc6dd186a2878daed788abb601bb61657cc4 100644 (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);