From 3cfef587ebc09596836f6f19fb5fea7b562e3c38 Mon Sep 17 00:00:00 2001 From: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Date: Wed, 11 Sep 2024 04:44:43 -0500 Subject: [PATCH] Examine Hud hotfixing (#86607) ## About The Pull Request I tested these in every single iteration but the final one. So it was doing `string + list()` and runtiming because it lost a `. = list()` ## Changelog :cl: Melbert fix: Med/sec hud examine /:cl: --- code/modules/mob/living/carbon/examine.dm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/examine.dm b/code/modules/mob/living/carbon/examine.dm index a4d41de9cbc..cb0f7f50bb6 100644 --- a/code/modules/mob/living/carbon/examine.dm +++ b/code/modules/mob/living/carbon/examine.dm @@ -472,25 +472,33 @@ return /mob/living/carbon/human/get_hud_examine_info(mob/living/user) + . = list() + var/perpname = get_face_name(get_id_name("")) + var/title = "" if(perpname && (HAS_TRAIT(user, TRAIT_SECURITY_HUD) || HAS_TRAIT(user, TRAIT_MEDICAL_HUD)) && (user.stat == CONSCIOUS || isobserver(user)) && user != src) var/datum/record/crew/target_record = find_record(perpname) if(target_record) . += "Rank: [target_record.rank]" . += "\[Front photo\]\[Side photo\]" if(HAS_TRAIT(user, TRAIT_MEDICAL_HUD) && HAS_TRAIT(user, TRAIT_SECURITY_HUD)) - . += separator_hr("Medical & Security Analysis") + title = separator_hr("Medical & Security Analysis") . += get_medhud_examine_info(user, target_record) . += get_sechud_examine_info(user, target_record) else if(HAS_TRAIT(user, TRAIT_MEDICAL_HUD)) - . += separator_hr("Medical Analysis") + title = separator_hr("Medical Analysis") . += get_medhud_examine_info(user, target_record) else if(HAS_TRAIT(user, TRAIT_SECURITY_HUD)) - . += separator_hr("Security Analysis") + title = separator_hr("Security Analysis") . += get_sechud_examine_info(user, target_record) + // applies the separator correctly without an extra line break + if(title && length(.)) + .[1] = title + .[1] + return . + /// Collects information displayed about src when examined by a user with a medical HUD. /mob/living/carbon/proc/get_medhud_examine_info(mob/living/user, datum/record/crew/target_record) . = list()