Skip to content

Commit

Permalink
[MIRROR] Fix handcuffing (#2073)
Browse files Browse the repository at this point in the history
* Fix handcuffing (#82760)

Changed this to an early return but then didn't invert the condition

:cl: Melbert
fix: You can handcuff people with 2 arms and you can no longer handcuff
people with 0 arms
/:cl:

* Fix handcuffing

---------

Co-authored-by: MrMelbert <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Apr 19, 2024
1 parent cd8ed59 commit 166ada3
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions code/game/objects/items/handcuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,45 @@
if(!istype(C))
return

<<<<<<< HEAD

Check failure on line 77 in code/game/objects/items/handcuffs.dm

View workflow job for this annotation

GitHub Actions / Run Linters

got '<<', expected one of: newline, '/', identifier
if(SEND_SIGNAL(C, COMSIG_CARBON_CUFF_ATTEMPTED, user) & COMSIG_CARBON_CUFF_PREVENT)
=======
attempt_to_cuff(target_mob, user)

/// Handles all of the checks and application in a typical situation where someone attacks a carbon victim with the handcuff item.
/obj/item/restraints/handcuffs/proc/attempt_to_cuff(mob/living/carbon/victim, mob/living/user)
if(SEND_SIGNAL(victim, COMSIG_CARBON_CUFF_ATTEMPTED, user) & COMSIG_CARBON_CUFF_PREVENT)
victim.balloon_alert(user, "can't be handcuffed!")
>>>>>>> e640bd79f2f ([MIRROR] Fix handcuffing (#2073))
return

if(iscarbon(user) && (HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))) //Clumsy people have a 50% chance to handcuff themselves instead of their target.
to_chat(user, span_warning("Uh... how do those things work?!"))
apply_cuffs(user,user)
return

<<<<<<< HEAD
=======
if(!isnull(victim.handcuffed))
victim.balloon_alert(user, "already handcuffed!")
return

if(!victim.canBeHandcuffed())
victim.balloon_alert(user, "can't be handcuffed!")
return

victim.visible_message(
span_danger("[user] is trying to put [src] on [victim]!"),
span_userdanger("[user] is trying to put [src] on you!"),
)

if(victim.is_blind())
to_chat(victim, span_userdanger("As you feel someone grab your wrists, [src] start digging into your skin!"))

playsound(loc, cuffsound, 30, TRUE, -2)
log_combat(user, victim, "attempted to handcuff")

>>>>>>> e640bd79f2f ([MIRROR] Fix handcuffing (#2073))
if(HAS_TRAIT(user, TRAIT_FAST_CUFFING))
handcuff_time_mod = 0.75
else
Expand Down

0 comments on commit 166ada3

Please sign in to comment.