[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 <silent_insomnia_pp@hotmail.co.uk>
This commit is contained in:
SkyratBot
2021-06-26 17:11:45 +02:00
committed by GitHub
parent 9b81b7dca8
commit b9c1cda706
@@ -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)