Fixes changlings transformed into a Felinid losing decap immunity thanks to their newly shrunken brain (#95205)

## About The Pull Request

Fixes #95203

Changling "decoy brain" status was a behavior attached to the brain. 
However it never re-applied the "decoy brain" status at any point. Even
if your brain changed.

This was fine for the most part because all of our roundstart species
used the same base brain type.
Which meant your brain didn't change and there was no reason to re-apply
the behavior.

But now Felinids (*and Lizardpeople*) have a different brain typepath.
Changing into these species would give you an entirely new brain and
wipe the "decoy brain" mechanic entirely without re-applying it.

This PR fixes the issue by re-applying "decoy brain" status the ling has
a new brain added.

## Changelog

🆑 Melbert
fix: Fixes Changlings transformed into a Felinid losing decap immunity
thanks to their newly shrunken brain
/🆑

---------

Co-authored-by: Jordan Dominion <jordanhcbrown+github@gmail.com>
Co-authored-by: Arturlang <24881678+Arturlang@users.noreply.github.com>
This commit is contained in:
MrMelbert
2026-02-22 20:24:24 -06:00
committed by GitHub
parent 591f6e95c2
commit 3c527a6dce
2 changed files with 32 additions and 1 deletions
+14
View File
@@ -5,6 +5,7 @@
var/mob/living/carbon/human/ling = allocate(/mob/living/carbon/human/consistent)
ling.mind_initialize()
ling.mind.add_antag_datum(/datum/antagonist/changeling)
test_setup(ling)
var/obj/item/bodypart/head/noggin = ling.get_bodypart(BODY_ZONE_HEAD)
noggin.dismember()
@@ -24,6 +25,19 @@
for(var/obj/item/organ/leftover in ling.loc)
qdel(leftover)
/datum/unit_test/ling_decap/proc/test_setup(mob/living/carbon/human/ling)
return
/// Test lings don't die when decapitated after transforming to a species with a new brain typepath
/datum/unit_test/ling_decap/post_species_change
/datum/unit_test/ling_decap/post_species_change/test_setup(mob/living/carbon/human/ling)
// Regression test for a bug where changing to a species with a new brain would wipe the special changeling handling
var/obj/item/organ/brain/oldbrain = ling.get_organ_slot(ORGAN_SLOT_BRAIN)
ling.set_species(/datum/species/human/felinid)
var/obj/item/organ/brain/newbrain = ling.get_organ_slot(ORGAN_SLOT_BRAIN)
TEST_ASSERT(oldbrain.type != newbrain.type, "Changeling decap test setup failed to change the ling's brain typepath when changing their species.")
/// Tests people get decapitated properly.
/datum/unit_test/normal_decap