Skip to content

Commit

Permalink
Examine Hud hotfixing (tgstation#86607)
Browse files Browse the repository at this point in the history
## 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:
  • Loading branch information
MrMelbert authored Sep 11, 2024
1 parent 032bf5f commit 3cfef58
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions code/modules/mob/living/carbon/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
. += "<a href='?src=[REF(src)];hud=1;photo_front=1;examine_time=[world.time]'>\[Front photo\]</a><a href='?src=[REF(src)];hud=1;photo_side=1;examine_time=[world.time]'>\[Side photo\]</a>"
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()
Expand Down

0 comments on commit 3cfef58

Please sign in to comment.