From 12db35a383e7fd5ab8b66aaafe26bc759f3e4338 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 12 Oct 2022 19:52:00 +0200 Subject: [PATCH] [MIRROR] Fixes weather listener and area sound manager runtime when brains are inserted into corpses. [MDB IGNORE] (#16794) * 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. * Fixes weather listener and area sound manager runtime when brains are inserted into corpses. Co-authored-by: ShizCalev --- 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)