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)
This commit is contained in:
Gamer025
2021-05-30 01:34:14 -07:00
committed by GitHub
parent 4b0f7c138c
commit 03b2a8b20f
@@ -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