From cc4e7cae40ee691f6ea6a1f61097b168a7bccb1d Mon Sep 17 00:00:00 2001 From: Cameron Lennox Date: Sun, 2 Mar 2025 19:45:46 -0500 Subject: [PATCH] Fixes accessories and a few others not showing properly (#17255) * better fix Also fixes it in a few other places * fix that * gloves * no doublechecking H --------- Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> --- .../technomancer/devices/gloves_of_regen.dm | 35 ++++++++++--------- .../modules/clothing/accessories/accessory.dm | 3 +- .../modules/clothing/accessories/badges_vr.dm | 3 +- code/modules/clothing/clothing.dm | 8 ++--- code/modules/clothing/shoes/magboots.dm | 16 ++++----- 5 files changed, 33 insertions(+), 32 deletions(-) diff --git a/code/game/gamemodes/technomancer/devices/gloves_of_regen.dm b/code/game/gamemodes/technomancer/devices/gloves_of_regen.dm index 0c2f5b6544e..af6d9cf0a5c 100644 --- a/code/game/gamemodes/technomancer/devices/gloves_of_regen.dm +++ b/code/game/gamemodes/technomancer/devices/gloves_of_regen.dm @@ -19,23 +19,27 @@ min_cold_protection_temperature = GLOVES_MIN_COLD_PROTECTION_TEMPERATURE max_heat_protection_temperature = GLOVES_MAX_HEAT_PROTECTION_TEMPERATURE -/obj/item/clothing/gloves/regen/equipped(var/mob/living/carbon/human/H) - if(H && H.gloves == src) - wearer = WEAKREF(H) - if(H.can_feel_pain()) - to_chat(H, span_danger("You feel a stabbing sensation in your hands as you slide \the [src] on!")) - H.custom_pain("You feel a sharp pain in your hands!",1) +/obj/item/clothing/gloves/regen/equipped(var/mob/user) + if(ishuman(user)) + var/mob/living/carbon/human/H = user + if(H.gloves == src) + wearer = WEAKREF(H) + if(H.can_feel_pain()) + to_chat(H, span_danger("You feel a stabbing sensation in your hands as you slide \the [src] on!")) + H.custom_pain("You feel a sharp pain in your hands!",1) ..() -/obj/item/clothing/gloves/regen/dropped(var/mob/living/carbon/human/H) + +/obj/item/clothing/gloves/regen/dropped(var/mob/user) ..() - wearer?.resolve() - H = wearer - if(ishuman(H)) - if(H.can_feel_pain()) - to_chat(H, span_danger("You feel the hypodermic needles as you slide \the [src] off!")) - H.custom_pain("Your hands hurt like hell!",1) - wearer = null + + if(!ishuman(user)) + return + + var/mob/living/carbon/human/H = user + if(H.can_feel_pain()) + to_chat(H, span_danger("You feel the hypodermic needles as you slide \the [src] off!")) + H.custom_pain("Your hands hurt like hell!",1) /obj/item/clothing/gloves/regen/Initialize(mapload) . = ..() @@ -47,8 +51,7 @@ return ..() /obj/item/clothing/gloves/regen/process() - wearer?.resolve() - var/mob/living/carbon/human/H = wearer + var/mob/living/carbon/human/H = wearer?.resolve() if(!ishuman(H) || H.isSynthetic() || H.stat == DEAD || H.nutrition <= 10) return // Robots and dead people don't have a metabolism. diff --git a/code/modules/clothing/accessories/accessory.dm b/code/modules/clothing/accessories/accessory.dm index 69cd7f66f9c..2d723229913 100644 --- a/code/modules/clothing/accessories/accessory.dm +++ b/code/modules/clothing/accessories/accessory.dm @@ -49,8 +49,7 @@ else wearer = null - wearer?.resolve() - var/mob/living/carbon/human/H = wearer + var/mob/living/carbon/human/H = wearer?.resolve() if(!ishuman(H)) return diff --git a/code/modules/clothing/accessories/badges_vr.dm b/code/modules/clothing/accessories/badges_vr.dm index 2f0742526bb..91a70be3184 100644 --- a/code/modules/clothing/accessories/badges_vr.dm +++ b/code/modules/clothing/accessories/badges_vr.dm @@ -58,8 +58,7 @@ return ..() /obj/item/clothing/accessory/dosimeter/proc/check_holder() - wearer?.resolve() - var/mob/living/carbon/human/H = wearer + var/mob/living/carbon/human/H = wearer?.resolve() if(H) if(current_film && (H.radiation >= 25) && (current_film.state == 0)) update_state(1) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 3a6a477b6a1..5ff77965afc 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -423,10 +423,12 @@ /obj/item/clothing/gloves/dropped(mob/user) ..() - var/mob/living/carbon/human/H = wearer?.resolve() - if(!ishuman(H)) + punch_force = initial(punch_force) + wearer = null + if(!ishuman(user)) return + var/mob/living/carbon/human/H = user if(gloves) //We have nested gloves! Gloves under our gloves! if(!H.equip_to_slot_if_possible(gloves, slot_gloves)) gloves.forceMove(get_turf(src)) @@ -437,8 +439,6 @@ if(!H.equip_to_slot_if_possible(ring, slot_gloves)) ring.forceMove(get_turf(src)) src.ring = null - punch_force = initial(punch_force) - wearer = null /obj/item/clothing/gloves var/datum/unarmed_attack/special_attack = null //do the gloves have a special unarmed attack? diff --git a/code/modules/clothing/shoes/magboots.dm b/code/modules/clothing/shoes/magboots.dm index 532c897c642..04847de5e84 100644 --- a/code/modules/clothing/shoes/magboots.dm +++ b/code/modules/clothing/shoes/magboots.dm @@ -71,16 +71,16 @@ /obj/item/clothing/shoes/magboots/dropped(mob/user) ..() - - wearer?.resolve() - var/mob/living/carbon/human/H = wearer - - if(ishuman(H) && shoes) - if(!H.equip_to_slot_if_possible(shoes, slot_shoes)) - shoes.forceMove(get_turf(src)) - shoes = null wearer = null + var/mob/living/carbon/human/H = user + if(!ishuman(H) || !shoes) + return + + if(!H.equip_to_slot_if_possible(shoes, slot_shoes)) + shoes.forceMove(get_turf(src)) + shoes = null + /obj/item/clothing/shoes/magboots/examine(mob/user) . = ..() . += "Its mag-pulse traction system appears to be [item_flags & NOSLIP ? "enabled" : "disabled"]."