From 03b2a8b20ffbfa6cf413d8b780bf891029d78c91 Mon Sep 17 00:00:00 2001 From: Gamer025 <33846895+Gamer025@users.noreply.github.com> Date: Sun, 30 May 2021 10:34:14 +0200 Subject: [PATCH] Fix runtime caused by organs without owner #59311 added a check to prevent unconscious people from receiving organ damage messages. However this causes runtimes for organs lying around without an owner: This checks if owner is not null before trying to get stats (?. can't be used because null <= SOFT_CRIT would be true) --- code/modules/surgery/organs/organ_internal.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index e6484788f18..442d72a3963 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -172,7 +172,7 @@ damage = clamp(damage + damage_amount, 0, maximum) var/mess = check_damage_thresholds(owner) prev_damage = damage - if(mess && owner.stat <= SOFT_CRIT) + if(mess && owner && owner.stat <= SOFT_CRIT) to_chat(owner, mess) ///SETS an organ's damage to the amount "damage_amount", and in doing so clears or sets the failing flag, good for when you have an effect that should fix an organ if broken