diff --git a/code/game/objects/items/devices/scanners/health_analyzer.dm b/code/game/objects/items/devices/scanners/health_analyzer.dm
index 1230fb23db7..0f87ed0627d 100644
--- a/code/game/objects/items/devices/scanners/health_analyzer.dm
+++ b/code/game/objects/items/devices/scanners/health_analyzer.dm
@@ -395,36 +395,44 @@
return
if(istype(target) && target.reagents)
- var/render_list = list()
+ var/list/render_list = list() //The master list of readouts, including reagents in the blood/stomach, addictions, quirks, etc.
+ var/list/render_block = list() //A second block of readout strings. If this ends up empty after checking stomach/blood contents, we give the "empty" header.
// Blood reagents
if(target.reagents.reagent_list.len)
- render_list += "Subject contains the following reagents in their blood:\n"
for(var/r in target.reagents.reagent_list)
var/datum/reagent/reagent = r
if(reagent.chemical_flags & REAGENT_INVISIBLE) //Don't show hidden chems on scanners
continue
- render_list += "[round(reagent.volume, 0.001)] units of [reagent.name][reagent.overdosed ? " - [span_boldannounce("OVERDOSING")]" : "."]\n"
- else
+ render_block += "[round(reagent.volume, 0.001)] units of [reagent.name][reagent.overdosed ? " - [span_boldannounce("OVERDOSING")]" : "."]\n"
+
+ if(!length(render_block)) //If no VISIBLY DISPLAYED reagents are present, we report as if there is nothing.
render_list += "Subject contains no reagents in their blood.\n"
+ else
+ render_list += "Subject contains the following reagents in their blood:\n"
+ render_list += render_block //Otherwise, we add the header, reagent readouts, and clear the readout block for use on the stomach.
+ render_block.Cut()
// Stomach reagents
var/obj/item/organ/internal/stomach/belly = target.getorganslot(ORGAN_SLOT_STOMACH)
if(belly)
if(belly.reagents.reagent_list.len)
- render_list += "Subject contains the following reagents in their stomach:\n"
for(var/bile in belly.reagents.reagent_list)
var/datum/reagent/bit = bile
- if(bit.chemical_flags & REAGENT_INVISIBLE) //Don't show hidden chems on scanners
+ if(bit.chemical_flags & REAGENT_INVISIBLE)
continue
if(!belly.food_reagents[bit.type])
- render_list += "[round(bit.volume, 0.001)] units of [bit.name][bit.overdosed ? " - [span_boldannounce("OVERDOSING")]" : "."]\n"
+ render_block += "[round(bit.volume, 0.001)] units of [bit.name][bit.overdosed ? " - [span_boldannounce("OVERDOSING")]" : "."]\n"
else
var/bit_vol = bit.volume - belly.food_reagents[bit.type]
if(bit_vol > 0)
- render_list += "[round(bit_vol, 0.001)] units of [bit.name][bit.overdosed ? " - [span_boldannounce("OVERDOSING")]" : "."]\n"
- else
+ render_block += "[round(bit_vol, 0.001)] units of [bit.name][bit.overdosed ? " - [span_boldannounce("OVERDOSING")]" : "."]\n"
+
+ if(!length(render_block))
render_list += "Subject contains no reagents in their stomach.\n"
+ else
+ render_list += "Subject contains the following reagents in their stomach:\n"
+ render_list += render_block
// Addictions
if(LAZYLEN(target.mind?.active_addictions))