From a580ddaaa9f4d9269a0af50fbd5f9cd8196854c8 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 20 Nov 2024 12:23:49 -0600 Subject: [PATCH] Fix lustrous brain trauma not removing during polymorph (#88014) ## About The Pull Request - Fixes #87897 There was an exploit where you can polymorph into the lustrous race and gain the beneficial brain trauma and then polymorph into another race and still keep the trauma. The code was transferring the brain traumas to the new body before it was deleted from the brain. It's now fixed. Special thanks to Melber for coming up with a better solution than the ones I brainstormed. ## Why It's Good For The Game Exploits are bad m'kay. ## Changelog :cl: timothymtorres, MrMelbert fix: Fix lustrous brain trauma not removing during polymorph /:cl: --- code/modules/mob/living/brain/brain_item.dm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index c17eaa1d526..629d79a76b8 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -449,6 +449,14 @@ can_smoothen_out = FALSE organ_traits = list(TRAIT_ADVANCEDTOOLUSER, TRAIT_LITERATE, TRAIT_CAN_STRIP) +// This fixes an edge case from species/regenerate_organs that would transfer the brain trauma before organ/on_mob_remove can remove it +// Prevents wizards from using the magic mirror to gain bluespace_prophet trauma and then switching to another race +/obj/item/organ/brain/lustrous/before_organ_replacement(obj/item/organ/replacement) + if(owner) + owner.cure_trauma_type(/datum/brain_trauma/special/bluespace_prophet, TRAUMA_RESILIENCE_ABSOLUTE) + owner.RemoveElement(/datum/element/tenacious) + . = ..() + /obj/item/organ/brain/lustrous/on_mob_remove(mob/living/carbon/organ_owner, special) . = ..() organ_owner.cure_trauma_type(/datum/brain_trauma/special/bluespace_prophet, TRAUMA_RESILIENCE_ABSOLUTE)