From ac9462da52db987b792f077a992affc98b72dda3 Mon Sep 17 00:00:00 2001 From: Roxy <75404941+TealSeer@users.noreply.github.com> Date: Mon, 27 Oct 2025 19:09:48 -0400 Subject: [PATCH] Fix flaky ears CI failures (#4855) ## About The Pull Request - Prioritize checking `dna.mutant_bodyparts` before `dna.features` when imprinting sprite accessories on organs - Add missing mutantpart_key to ears - Add check for `mutant_bodyparts` settings in `should_visual_organ_apply_to` ## Why It's Good For The Game Fixes #4851 Fixes #4845 Fixes #4838 Fixes #4836 Fixes #4831 ## Proof Of Testing Tested that mobs get the correct bodypart overlay based on mutant bodyparts info and that species with special ears retained them ## Changelog N/A --- .../bodypart_overlays/mutant_bodypart_overlay.dm | 16 ++++++---------- .../surgery/organs/external/_visual_organs.dm | 6 ++++++ .../customization/modules/surgery/organs/ears.dm | 4 ++++ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/code/datums/bodypart_overlays/mutant_bodypart_overlay.dm b/code/datums/bodypart_overlays/mutant_bodypart_overlay.dm index 85c938749f0..71cf1fc09ff 100644 --- a/code/datums/bodypart_overlays/mutant_bodypart_overlay.dm +++ b/code/datums/bodypart_overlays/mutant_bodypart_overlay.dm @@ -33,19 +33,15 @@ stack_trace("adding a [parent.type] to a [receiver.type] when it shouldn't be!") if(imprint_on_next_insertion) //We only want this set *once* - var/feature_name = receiver.dna.features[feature_key] // BUBBER EDIT CHANGE - Original: var/feature_name = receiver.dna.features[feature_key] || receiver.dna.species.mutant_organs[parent.type] + // BUBBER EDIT CHANGE BEGIN - try mutant_bodyparts method before features + imprint_on_next_insertion = FALSE + if(set_appearance_from_dna(receiver.dna)) + return + var/feature_name = receiver.dna.features[feature_key] || receiver.dna.species.mutant_organs[parent.type] if (isnull(feature_name)) - /* SKYRAT EDIT - Customization - ORIGINAL: - stack_trace("[type] has no default feature name for organ [parent.type]!") feature_name = get_consistent_feature_entry(get_global_feature_list()) //fallback to something set_appearance_from_name(feature_name) - */ // SKYRAT EDIT START - if(!set_appearance_from_dna(receiver.dna)) - set_appearance_from_name(receiver.dna.species.mutant_organs[parent.type] || get_consistent_feature_entry(get_global_feature_list())) - else - set_appearance_from_name(feature_name) - // SKYRAT EDIT END - imprint_on_next_insertion = FALSE + // BUBBER EDIT CHANGE END /datum/bodypart_overlay/mutant/get_overlay(layer, obj/item/bodypart/limb) inherit_color(limb) // If draw_color is not set yet, go ahead and do that diff --git a/code/modules/surgery/organs/external/_visual_organs.dm b/code/modules/surgery/organs/external/_visual_organs.dm index 26113c8bb87..ca77c57ef88 100644 --- a/code/modules/surgery/organs/external/_visual_organs.dm +++ b/code/modules/surgery/organs/external/_visual_organs.dm @@ -64,6 +64,12 @@ Unlike normal organs, we're actually inside a persons limbs at all times if(target.dna.features[feature_key] != SPRITE_ACCESSORY_NONE) return TRUE + + // BUBBER EDIT ADDITION BEGIN - Customization + if(target.dna.mutant_bodyparts[feature_key] && target.dna.mutant_bodyparts[feature_key][MUTANT_INDEX_NAME] != SPRITE_ACCESSORY_NONE) + return TRUE + // BUBBER EDIT ADDITION END + return FALSE ///Update our features after something changed our appearance diff --git a/modular_skyrat/modules/customization/modules/surgery/organs/ears.dm b/modular_skyrat/modules/customization/modules/surgery/organs/ears.dm index 1c115518981..6811ee9ed87 100644 --- a/modular_skyrat/modules/customization/modules/surgery/organs/ears.dm +++ b/modular_skyrat/modules/customization/modules/surgery/organs/ears.dm @@ -1,3 +1,7 @@ +/obj/item/organ/ears + mutantpart_key = "ears" + mutantpart_info = list(MUTANT_INDEX_NAME = "Cat", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF")) + /obj/item/organ/ears/mutant name = "fluffy ears" desc = "Wait, there's two pairs of these?"