Fixes runtime with the infective component on gibs (#70706)

* Fixes runtime with the infective component. streak_diseases is a lazylist and is sometimes not instantiated.

* Lazynull
This commit is contained in:
MrMelbert
2022-10-23 15:33:16 -04:00
committed by GitHub
parent a3c791acfe
commit f1952b8d28
2 changed files with 9 additions and 1 deletions
+4
View File
@@ -117,6 +117,10 @@
/datum/component/infective/proc/try_infect_streak(datum/source, list/directions, list/output_diseases)
SIGNAL_HANDLER
// This blood is not infectable / does not have a diseases list
if(!islist(output_diseases))
return
output_diseases |= diseases
/datum/component/infective/proc/try_infect(mob/living/L, target_zone)
@@ -116,6 +116,10 @@
. = ..()
RegisterSignal(src, COMSIG_MOVABLE_PIPE_EJECTING, .proc/on_pipe_eject)
/obj/effect/decal/cleanable/blood/gibs/Destroy()
LAZYNULL(streak_diseases)
return ..()
/obj/effect/decal/cleanable/blood/gibs/replace_decal(obj/effect/decal/cleanable/C)
return FALSE //Never fail to place us
@@ -145,9 +149,9 @@
streak(dirs)
/obj/effect/decal/cleanable/blood/gibs/proc/streak(list/directions, mapload=FALSE)
LAZYINITLIST(streak_diseases)
SEND_SIGNAL(src, COMSIG_GIBS_STREAK, directions, streak_diseases)
var/direction = pick(directions)
streak_diseases = list()
var/delay = 2
var/range = pick(0, 200; 1, 150; 2, 50; 3, 17; 50) //the 3% chance of 50 steps is intentional and played for laughs.
if(!step_to(src, get_step(src, direction), 0))