From bb79294b2e84add9043c8b635c6d4c01e5a40067 Mon Sep 17 00:00:00 2001 From: ShizCalev Date: Tue, 11 Oct 2022 21:38:57 -0400 Subject: [PATCH] Fixes weather listener and area sound manager runtime when brains are inserted into corpses. (#70343) Essentially, the brain is set to nullspace for a second when inserted into a body, which was messing with brain mobs since z_level_change wasn't expecting the loc to be a null turf. (mobs in nullspace are bad.) At this very same moment though, the brain obj's owner (carbon) is set, so we can just report that since that's going to be the loc sent to the signal again in half a moment anyway. --- code/modules/mob/living/brain/brain.dm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/modules/mob/living/brain/brain.dm b/code/modules/mob/living/brain/brain.dm index 9be5ba56743..e175be5cd9c 100644 --- a/code/modules/mob/living/brain/brain.dm +++ b/code/modules/mob/living/brain/brain.dm @@ -20,6 +20,12 @@ ADD_TRAIT(src, TRAIT_HANDS_BLOCKED, BRAIN_UNAIDED) +/mob/living/brain/on_changed_z_level(turf/old_turf, turf/new_turf, same_z_layer, notify_contents) + var/obj/item/organ/internal/brain/brain_loc = loc + if(brain_loc && isnull(new_turf) && brain_loc.owner) //we're actively being put inside a new body. + return ..(old_turf, get_turf(brain_loc.owner), same_z_layer, notify_contents) + return ..() + /mob/living/brain/proc/create_dna() stored_dna = new /datum/dna/stored(src) if(!stored_dna.species)