From 3db5159e1193c79612011804d7616263d4cd3f27 Mon Sep 17 00:00:00 2001 From: theOOZ Date: Tue, 26 Aug 2025 23:47:57 +0200 Subject: [PATCH] Fixes `external_bodyshapes` not always applying its bodyshape to owner (#92698) ## About The Pull Request The synchronize procs ran too early and would miss out on the last organ loaded, which is more likely to happen than you think. ## Why It's Good For The Game In case TG ever wants to code mask sprites for snouted humanoids, you'll want this to work. --- code/modules/surgery/organs/organ_movement.dm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/code/modules/surgery/organs/organ_movement.dm b/code/modules/surgery/organs/organ_movement.dm index fb63d46eb26..1eef03f0840 100644 --- a/code/modules/surgery/organs/organ_movement.dm +++ b/code/modules/surgery/organs/organ_movement.dm @@ -74,11 +74,6 @@ wash(CLEAN_TYPE_BLOOD) organ_flags &= ~ORGAN_VIRGIN - if(external_bodytypes) - receiver.synchronize_bodytypes() - if(external_bodyshapes) - receiver.synchronize_bodyshapes() - receiver.organs |= src receiver.organs_slot[slot] = src owner = receiver @@ -141,6 +136,11 @@ ADD_TRAIT(src, TRAIT_NODROP, ORGAN_INSIDE_BODY_TRAIT) interaction_flags_item &= ~INTERACT_ITEM_ATTACK_HAND_PICKUP + if(external_bodytypes) + limb.owner?.synchronize_bodytypes() + if(external_bodyshapes) + limb.owner?.synchronize_bodyshapes() + if(bodypart_overlay) limb.add_bodypart_overlay(bodypart_overlay) @@ -186,8 +186,6 @@ SEND_SIGNAL(organ_owner, COMSIG_CARBON_LOSE_ORGAN, src, special) ADD_TRAIT(src, TRAIT_USED_ORGAN, ORGAN_TRAIT) - organ_owner.synchronize_bodytypes() - organ_owner.synchronize_bodyshapes() if(!special) organ_owner.hud_used?.update_locked_slots() @@ -248,6 +246,9 @@ REMOVE_TRAIT(src, TRAIT_NODROP, ORGAN_INSIDE_BODY_TRAIT) interaction_flags_item |= INTERACT_ITEM_ATTACK_HAND_PICKUP + limb.owner?.synchronize_bodytypes() + limb.owner?.synchronize_bodyshapes() + if(!bodypart_overlay) return