From b9c1cda706ccc2479ad419e401e6d506b4fca5bb Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sat, 26 Jun 2021 17:11:45 +0200 Subject: [PATCH] [MIRROR] Fix incorrect return for closet attack_hand_secondary causing lockers to have their locks toggled twice. (#6536) * Fix incorrect return for closet attack_hand_secondary causing lockers to have their locks toggled twice. (#59814) /obj/structure/closet/attack_hand_secondary(mob/user, modifiers) doesn't return one of the expected attack chain cancelling/continuing defines and instead returns TRUE. This means that right clicking them acts as a secondary attack followed by a primary attack. When the secondary attack against a secure closet actually attempts to toggle the lock, it now cancels the entire attack chain. * Fix incorrect return for closet attack_hand_secondary causing lockers to have their locks toggled twice. Co-authored-by: Timberpoes --- code/game/objects/structures/crates_lockers/closets.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 3d268549853..9491afba6de 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -469,9 +469,10 @@ /obj/structure/closet/RightClick(mob/user, modifiers) if(!user.canUseTopic(src, BE_CLOSE) || !isturf(loc)) return + if(!opened && secure) togglelock(user) - return TRUE + return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN /obj/structure/closet/proc/togglelock(mob/living/user, silent) if(secure && !broken)