From 521957efe998edfb00898cb610d7bde84e485ab7 Mon Sep 17 00:00:00 2001 From: Lucy Date: Thu, 26 Sep 2024 10:15:11 -0400 Subject: [PATCH] Fix pathogen runtime with null wearers --- .../modules/virology/effects/pathogen_cloud.dm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/monkestation/code/modules/virology/effects/pathogen_cloud.dm b/monkestation/code/modules/virology/effects/pathogen_cloud.dm index 42dd86e2b45935..2de81917fe0272 100644 --- a/monkestation/code/modules/virology/effects/pathogen_cloud.dm +++ b/monkestation/code/modules/virology/effects/pathogen_cloud.dm @@ -55,9 +55,10 @@ GLOBAL_LIST_INIT(science_goggles_wearers, list()) pathogen = image('monkestation/code/modules/virology/icons/96x96.dmi',src,"pathogen_airborne") pathogen.plane = HUD_PLANE pathogen.appearance_flags = RESET_COLOR|RESET_ALPHA - for (var/mob/living/L as anything in GLOB.science_goggles_wearers) - if (L.client) - L.client.images |= pathogen + for (var/mob/living/wearer as anything in GLOB.science_goggles_wearers) + if(QDELETED(wearer) || QDELETED(wearer.client)) + continue + wearer.client.images |= pathogen source = sourcemob @@ -85,9 +86,10 @@ GLOBAL_LIST_INIT(science_goggles_wearers, list()) SSpathogen_clouds.current_run_clouds -= src if (pathogen) - for (var/mob/living/L in GLOB.science_goggles_wearers) - if (L.client) - L.client.images -= pathogen + for (var/mob/living/wearer as anything in GLOB.science_goggles_wearers) + if(QDELETED(wearer) || QDELETED(wearer.client)) + continue + wearer.client.images -= pathogen pathogen = null GLOB.pathogen_clouds -= src source = null