Skip to content

Commit

Permalink
No more runtimes when a limb takes damage with no owner (#23341)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Qwertytoforty and Contrabang authored Nov 29, 2023
1 parent 124910b commit d63e2c9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions code/modules/surgery/organs/organ_external.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d63e2c9

Please sign in to comment.