From f4dc140caa4b3f755afee264168862250a6006f6 Mon Sep 17 00:00:00 2001 From: Mira <42539014+MiraHell@users.noreply.github.com> Date: Mon, 10 Mar 2025 16:03:40 +0300 Subject: [PATCH] fix (#28599) --- code/datums/elements/strippable.dm | 14 ++++++++------ .../modules/mob/living/carbon/carbon_stripping.dm | 15 +++++++++------ .../mob/living/carbon/human/human_stripping.dm | 12 +++++++----- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/code/datums/elements/strippable.dm b/code/datums/elements/strippable.dm index 5c4385105c4..11a88c871d2 100644 --- a/code/datums/elements/strippable.dm +++ b/code/datums/elements/strippable.dm @@ -75,7 +75,8 @@ /// Start the equipping process. This is the proc you should yield in. /// Returns TRUE/FALSE depending on if it is allowed. /datum/strippable_item/proc/start_equip(atom/source, obj/item/equipping, mob/user) - if(!in_thief_mode(user)) + var/thief_mode = in_thief_mode(user) + if(!thief_mode) source.visible_message( "[user] tries to put [equipping] on [source].", "[user] tries to put [equipping] on you.", @@ -85,7 +86,7 @@ if(!victim_human.has_vision()) to_chat(victim_human, "You feel someone trying to put something on you.") - if(!do_mob(user, source, equipping.put_on_delay)) + if(!do_mob(user, source, equipping.put_on_delay, hidden = thief_mode)) return FALSE if(QDELETED(equipping) || !user.Adjacent(source) || (equipping.flags & NODROP)) @@ -127,7 +128,8 @@ add_attack_logs(user, source, "Attempting stripping of [item]") item.add_fingerprint(user) - if(!in_thief_mode(user)) + var/thief_mode = in_thief_mode(user) + if(!thief_mode) source.visible_message( "[user] tries to remove [source]'s [item.name].", "[user] tries to remove your [item.name].", @@ -138,7 +140,7 @@ if(!victim_human.has_vision()) to_chat(source, "You feel someone fumble with your belongings.") - return start_unequip_mob(get_item(source), source, user) + return start_unequip_mob(get_item(source), source, user, hidden = thief_mode) /// The proc that unequips the item from the source. This should not yield. /datum/strippable_item/proc/finish_unequip(atom/source, mob/user) @@ -255,10 +257,10 @@ return equipping.put_on_delay /// A utility function for `/datum/strippable_item`s to start unequipping an item from a mob. -/proc/start_unequip_mob(obj/item/item, mob/source, mob/user, strip_delay) +/proc/start_unequip_mob(obj/item/item, mob/source, mob/user, strip_delay, hidden = FALSE) if(!strip_delay) strip_delay = item.strip_delay - if(!do_mob(user, source, strip_delay)) + if(!do_mob(user, source, strip_delay, hidden = hidden)) return FALSE return TRUE diff --git a/code/modules/mob/living/carbon/carbon_stripping.dm b/code/modules/mob/living/carbon/carbon_stripping.dm index bb0c549726b..62cb221d9c0 100644 --- a/code/modules/mob/living/carbon/carbon_stripping.dm +++ b/code/modules/mob/living/carbon/carbon_stripping.dm @@ -36,17 +36,20 @@ /datum/strippable_item/mob_item_slot/mask/alternate_action(atom/source, mob/user, action_key) if(!..()) return + + var/thief_mode = in_thief_mode(user) + // Headpocket dislodging if(action_key == "dislodge_headpocket") var/mob/living/carbon/human/H = source var/obj/item/organ/internal/headpocket/pocket = H.get_int_organ(/obj/item/organ/internal/headpocket) if(!pocket.held_item) return - if(!in_thief_mode(user)) + if(!thief_mode) user.visible_message("[user] is trying to remove something from [source]'s head!", "You start to dislodge whatever's inside [source]'s headpocket!") - if(do_mob(user, source, POCKET_STRIP_DELAY)) - if(!in_thief_mode(user)) + if(do_mob(user, source, POCKET_STRIP_DELAY, hidden = thief_mode)) + if(!thief_mode) user.visible_message("[user] has dislodged something from [source]'s head!", "You have dislodged everything from [source]'s headpocket!") pocket.empty_contents() @@ -63,10 +66,10 @@ to_chat(user, "You lack the ability to manipulate the lock.") return - if(!in_thief_mode(user)) + if(!thief_mode) muzzle.visible_message("[user] tries to [muzzle.locked ? "unlock" : "lock"] [source]'s [muzzle.name].", \ "[user] tries to [muzzle.locked ? "unlock" : "lock"] [source]'s [muzzle.name].") - if(!do_mob(user, source, POCKET_STRIP_DELAY)) + if(!do_mob(user, source, POCKET_STRIP_DELAY, hidden = thief_mode)) return var/success = FALSE @@ -77,7 +80,7 @@ if(!success) return - if(!in_thief_mode(user)) + if(!thief_mode) muzzle.visible_message("[user] [muzzle.locked ? "locks" : "unlocks"] [source]'s [muzzle.name].", \ "[user] [muzzle.locked ? "locks" : "unlocks"] [source]'s [muzzle.name].") diff --git a/code/modules/mob/living/carbon/human/human_stripping.dm b/code/modules/mob/living/carbon/human/human_stripping.dm index 83e5084757f..238d437298f 100644 --- a/code/modules/mob/living/carbon/human/human_stripping.dm +++ b/code/modules/mob/living/carbon/human/human_stripping.dm @@ -59,16 +59,17 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list( if(!length(jumpsuit.accessories)) return var/obj/item/clothing/accessory/A = jumpsuit.accessories[1] - if(!in_thief_mode(user)) + var/thief_mode = in_thief_mode(user) + if(!thief_mode) user.visible_message("[user] starts to take off [A] from [source]'s [jumpsuit]!", \ "You start to take off [A] from [source]'s [jumpsuit]!") - if(!do_mob(user, source, POCKET_STRIP_DELAY)) + if(!do_mob(user, source, POCKET_STRIP_DELAY, hidden = thief_mode)) return if(QDELETED(A) || !(A in jumpsuit.accessories)) return - if(!in_thief_mode(user)) + if(!thief_mode) user.visible_message("[user] takes [A] off of [source]'s [jumpsuit]!", \ "You take [A] off of [source]'s [jumpsuit]!") jumpsuit.detach_accessory(A, user) @@ -157,9 +158,10 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list( add_attack_logs(user, source, "Attempting pickpocketing of [item]") item.add_fingerprint(user) - var/result = start_unequip_mob(item, source, user, POCKET_STRIP_DELAY) + var/thief_mode = in_thief_mode(user) + var/result = start_unequip_mob(item, source, user, POCKET_STRIP_DELAY, thief_mode) - if(!result && !in_thief_mode(user)) + if(!result && !thief_mode) warn_owner(source) return result