From d63e2c926e0f2b03a45e98feedd6122e6a77d4bd Mon Sep 17 00:00:00 2001 From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> Date: Wed, 29 Nov 2023 12:19:10 -0500 Subject: [PATCH] No more runtimes when a limb takes damage with no owner (#23341) * Update organ_external.dm * Update code/modules/surgery/organs/organ_external.dm Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com> --------- Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com> --- code/modules/surgery/organs/organ_external.dm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index 1111aee9f6b..682dd546920 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -307,8 +307,7 @@ //And pass the pain around var/obj/item/organ/external/target = pick(possible_points) target.receive_damage(brute, burn, sharp, used_weapon, forbidden_limbs + src, ignore_resists = TRUE) //If the damage was reduced before, don't reduce it again - - if(dismember_at_max_damage && body_part != UPPER_TORSO && body_part != LOWER_TORSO && !HAS_TRAIT(owner, TRAIT_IPC_JOINTS_SEALED)) // We've ensured all damage to the mob is retained, now let's drop it, if necessary. + if(owner && dismember_at_max_damage && body_part != UPPER_TORSO && body_part != LOWER_TORSO && !HAS_TRAIT(owner, TRAIT_IPC_JOINTS_SEALED)) // We've ensured all damage to the mob is retained, now let's drop it, if necessary. droplimb(1) //Clean loss, just drop the limb and be done var/mob/living/carbon/owner_old = owner //Need to update health, but need a reference in case the below check cuts off a limb.