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.
This commit is contained in:
ShizCalev
2022-10-12 14:38:57 +13:00
committed by GitHub
parent 4dfb30f36d
commit bb79294b2e
+6
View File
@@ -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)