From 0c25c793cecc06a4d6fb1f17702565f4fa46ce91 Mon Sep 17 00:00:00 2001 From: Zonespace <41448081+Zonespace27@users.noreply.github.com> Date: Thu, 28 Sep 2023 00:14:01 -0700 Subject: [PATCH] Fixes yautja bracers getting stuck in-hand (#4528) # About the pull request If a pred got gibbed/delimbed, they could drop their bracer with the NODROP flag still enabled. This meant the next person to pick it up, pred or not, would have it stuck on their hand. # Changelog :cl: fix: Picking up a dropped pred bracer will no longer leave it stuck to your hand. /:cl: --- code/modules/cm_preds/yaut_bracers.dm | 31 +++++++++++++++++---------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/code/modules/cm_preds/yaut_bracers.dm b/code/modules/cm_preds/yaut_bracers.dm index 4e5dcb8c6386..785378b04388 100644 --- a/code/modules/cm_preds/yaut_bracers.dm +++ b/code/modules/cm_preds/yaut_bracers.dm @@ -71,6 +71,7 @@ flags_item = initial(flags_item) UnregisterSignal(user, list(COMSIG_MOB_STAT_SET_ALIVE, COMSIG_MOB_DEATH)) SSminimaps.remove_marker(user) + unlock_bracer() // So as to prevent the bracer being stuck with nodrop if the pred gets gibbed/arm removed/etc. ..() /obj/item/clothing/gloves/yautja/pickup(mob/living/user) @@ -1164,18 +1165,26 @@ /// The actual unlock/lock function. /obj/item/clothing/gloves/yautja/proc/toggle_lock_internal(mob/wearer, force_lock) if(((flags_item & NODROP) || (flags_inventory & CANTSTRIP)) && !force_lock) - flags_item &= ~NODROP - flags_inventory &= ~CANTSTRIP - if(!isyautja(wearer)) - to_chat(wearer, SPAN_WARNING("The bracer beeps pleasantly, releasing it's grip on your forearm.")) - else - to_chat(wearer, SPAN_WARNING("With an angry blare the bracer releases your forearm.")) - return TRUE + return unlock_bracer() + return lock_bracer() + +/obj/item/clothing/gloves/yautja/proc/lock_bracer(mob/wearer) flags_item |= NODROP flags_inventory |= CANTSTRIP - if(isyautja(wearer)) - to_chat(wearer, SPAN_WARNING("The bracer clamps securely around your forearm and beeps in a comfortable, familiar way.")) - else - to_chat(wearer, SPAN_WARNING("The bracer clamps painfully around your forearm and beeps angrily. It won't come off!")) + if(wearer) + if(isyautja(wearer)) + to_chat(wearer, SPAN_WARNING("The bracer clamps securely around your forearm and beeps in a comfortable, familiar way.")) + else + to_chat(wearer, SPAN_WARNING("The bracer clamps painfully around your forearm and beeps angrily. It won't come off!")) + return TRUE + +/obj/item/clothing/gloves/yautja/proc/unlock_bracer(mob/wearer) + flags_item &= ~NODROP + flags_inventory &= ~CANTSTRIP + if(wearer) + if(!isyautja(wearer)) + to_chat(wearer, SPAN_WARNING("The bracer beeps pleasantly, releasing its grip on your forearm.")) + else + to_chat(wearer, SPAN_WARNING("With an angry blare, the bracer releases your forearm.")) return TRUE