From 7aa0019bc7fdf093225a2cc6d0ded16b6f1d5261 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 8 Jan 2021 00:11:41 +0100 Subject: [PATCH] [MIRROR] Nearsightness, Blindness, Tongue-tied on_spawn() code improvements, bug fixes (#2557) * Nearsightness, Blindness, Tongue-tied on_spawn() code improvements, bug fixes (#55807) Spawning equipment for nearsighted or tongue-tied people is now safe code-wise, and shouldnt do any bugs, nor will they delete your previous equipment. Also blindness doesn't call a redundant expensive proc * Nearsightness, Blindness, Tongue-tied on_spawn() code improvements, bug fixes Co-authored-by: Azarak --- code/datums/traits/negative.dm | 6 ++---- code/datums/traits/neutral.dm | 7 ++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/code/datums/traits/negative.dm b/code/datums/traits/negative.dm index 05bea7980ac..6699e179745 100644 --- a/code/datums/traits/negative.dm +++ b/code/datums/traits/negative.dm @@ -57,7 +57,6 @@ var/obj/item/clothing/glasses/blindfold/white/B = new(get_turf(H)) if(!H.equip_to_slot_if_possible(B, ITEM_SLOT_EYES, bypass_equip_delay_self = TRUE)) //if you can't put it on the user's eyes, put it in their hands, otherwise put it on their eyes H.put_in_hands(B) - H.regenerate_icons() /* A couple of brain tumor stats for anyone curious / looking at this quirk for balancing: * - It takes less 16 minute 40 seconds to die from brain death due to a brain tumor. @@ -318,9 +317,8 @@ /datum/quirk/nearsighted/on_spawn() var/mob/living/carbon/human/H = quirk_holder var/obj/item/clothing/glasses/regular/glasses = new(get_turf(H)) - H.put_in_hands(glasses) - H.equip_to_slot(glasses, ITEM_SLOT_EYES) - H.regenerate_icons() //this is to remove the inhand icon, which persists even if it's not in their hands + if(!H.equip_to_slot_if_possible(glasses, ITEM_SLOT_EYES, bypass_equip_delay_self = TRUE)) + H.put_in_hands(glasses) /datum/quirk/nyctophobia name = "Nyctophobia" diff --git a/code/datums/traits/neutral.dm b/code/datums/traits/neutral.dm index 3a92fe54ede..c72996c0000 100644 --- a/code/datums/traits/neutral.dm +++ b/code/datums/traits/neutral.dm @@ -257,15 +257,12 @@ var/mob/living/carbon/human/H = quirk_holder var/obj/item/organ/tongue/old_tongue = locate() in H.internal_organs var/obj/item/organ/tongue/tied/new_tongue = new(get_turf(H)) - var/obj/item/clothing/gloves/old_gloves = locate() in H var/obj/item/clothing/gloves/radio/gloves = new(get_turf(H)) old_tongue.Remove(H) new_tongue.Insert(H) qdel(old_tongue) - qdel(old_gloves) - H.put_in_hands(gloves) - H.equip_to_slot(gloves, ITEM_SLOT_GLOVES) - H.regenerate_icons() + if(!H.equip_to_slot_if_possible(gloves, ITEM_SLOT_GLOVES, bypass_equip_delay_self = TRUE)) + H.put_in_hands(gloves) /datum/quirk/tongue_tied/post_add() to_chat(quirk_holder, "Because you speak with your hands, having them full hinders your ability to communicate!")