From 9e45fbcb6433fe450d9e1a4ba9cb59f1870e375e Mon Sep 17 00:00:00 2001 From: Zonespace <41448081+Zonespace27@users.noreply.github.com> Date: Sun, 19 Nov 2023 03:02:39 -0800 Subject: [PATCH] Fix med_hud_set_health runtime for xenomorphs (#4951) # About the pull request Fixes below ![image](https://github.com/cmss13-devs/cmss13/assets/41448081/ef8b8ae6-9e23-420e-acbe-24ddf035b7e5) Same rationale as https://github.com/cmss13-devs/cmss13/pull/4948 --- code/datums/mob_hud.dm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/datums/mob_hud.dm b/code/datums/mob_hud.dm index b0df9bca7745..ff1263510761 100644 --- a/code/datums/mob_hud.dm +++ b/code/datums/mob_hud.dm @@ -283,6 +283,12 @@ var/list/datum/mob_hud/huds = list( return /mob/living/carbon/xenomorph/med_hud_set_health() + if(QDELETED(src)) + return + + if(!(HEALTH_HUD_XENO in hud_list)) + CRASH("hud_list lacks HEALTH_HUD_XENO despite not being deleted in med_hud_set_health()") + var/image/holder = hud_list[HEALTH_HUD_XENO] var/health_hud_type = "xenohealth"