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>
This commit is contained in:
Qwertytoforty
2023-11-29 12:19:10 -05:00
committed by GitHub
co-authored by Contrabang
parent 124910bb3f
commit d63e2c926e
@@ -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.