From 32186cb7fc4600e6d7c21e66002f54e5908d0650 Mon Sep 17 00:00:00 2001 From: Lumipharon Date: Thu, 10 Oct 2024 10:57:41 +1300 Subject: [PATCH] Z change fix (#16651) --- code/game/atoms/atom_movable.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/code/game/atoms/atom_movable.dm b/code/game/atoms/atom_movable.dm index c777084f793aa..8f0974d43435c 100644 --- a/code/game/atoms/atom_movable.dm +++ b/code/game/atoms/atom_movable.dm @@ -979,7 +979,7 @@ */ /atom/movable/proc/on_changed_z_level(turf/old_turf, turf/new_turf, notify_contents = TRUE) SHOULD_CALL_PARENT(TRUE) - SEND_SIGNAL(src, COMSIG_MOVABLE_Z_CHANGED, old_turf, new_turf) + SEND_SIGNAL(src, COMSIG_MOVABLE_Z_CHANGED, old_turf?.z, new_turf?.z) if(!notify_contents) return diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 20253ca5bbe7b..de5c395071746 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -8,7 +8,8 @@ GLOB.human_mob_list += src GLOB.alive_human_list += src - LAZYADD(GLOB.humans_by_zlevel["[z]"], src) + if(z) + LAZYADD(GLOB.humans_by_zlevel["[z]"], src) for(var/action in GLOB.human_init_actions) var/datum/action/human_action = new action(src)