From 621be362eb2217e588b95e31b95ee760782fbfe2 Mon Sep 17 00:00:00 2001 From: cuberound <122645057+cuberound@users.noreply.github.com> Date: Thu, 30 Nov 2023 22:28:15 +0100 Subject: [PATCH] adds returns to prevent runtimes hopefuly --- code/datums/components/healing_reduction.dm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/datums/components/healing_reduction.dm b/code/datums/components/healing_reduction.dm index b98d52cab251..acf55ebf7696 100644 --- a/code/datums/components/healing_reduction.dm +++ b/code/datums/components/healing_reduction.dm @@ -33,15 +33,18 @@ Humans will take continuous damage instead. /datum/component/healing_reduction/process(delta_time) if(!parent) qdel(src) + return + healing_reduction = max(healing_reduction - healing_reduction_dissipation * delta_time, 0) + if(healing_reduction <= 0) + qdel(src) + return + if(ishuman(parent)) //deals brute to humans var/mob/living/carbon/human/H = parent H.apply_damage(healing_reduction_dissipation * delta_time, BRUTE) - if(healing_reduction <= 0) - qdel(src) - var/color = GLOW_COLOR var/intensity = healing_reduction/max_buildup color += num2text(MAX_ALPHA*intensity, 2, 16)