Skip to content

Commit

Permalink
Fix pathogen runtime with null wearers
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy committed Sep 27, 2024
1 parent 1e6c6b4 commit 521957e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions monkestation/code/modules/virology/effects/pathogen_cloud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 521957e

Please sign in to comment.