From 4a40d64b96ea528e49ce4ff370786fe79b53bcb4 Mon Sep 17 00:00:00 2001 From: Doubleumc Date: Sat, 11 Nov 2023 19:21:30 -0500 Subject: [PATCH 1/2] initial --- code/modules/mob/dead/observer/observer.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 8d9513093349..54d6dc586cdc 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -249,7 +249,7 @@ ///makes the ghost see the target hud and sets the eye at the target. /mob/dead/observer/proc/do_observe(mob/target) - if(!client || !target || !istype(target)) + if(!client || !target || !ismovableatom(target)) return ManualFollow(target) From 297d4b25f76dcd43c9b1c4476da382a2b4e6c38a Mon Sep 17 00:00:00 2001 From: Doubleumc Date: Sun, 12 Nov 2023 16:25:14 -0500 Subject: [PATCH 2/2] fira --- code/modules/mob/dead/observer/observer.dm | 25 +++++++++++----------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 54d6dc586cdc..da0560e151e9 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -248,8 +248,8 @@ RegisterSignal(observe_target_client, COMSIG_CLIENT_SCREEN_REMOVE, PROC_REF(observe_target_screen_remove)) ///makes the ghost see the target hud and sets the eye at the target. -/mob/dead/observer/proc/do_observe(mob/target) - if(!client || !target || !ismovableatom(target)) +/mob/dead/observer/proc/do_observe(atom/movable/target) + if(!client || !target || !istype(target)) return ManualFollow(target) @@ -257,24 +257,23 @@ if(!ishuman(target) || !client.prefs?.auto_observe) return + var/mob/living/carbon/human/human_target = target - client.eye = target + client.eye = human_target - if(!target.hud_used) + if(!human_target.hud_used) return client.clear_screen() - LAZYINITLIST(target.observers) - target.observers |= src - target.hud_used.show_hud(target.hud_used.hud_version, src) - - var/mob/living/carbon/human/human_target = target + LAZYINITLIST(human_target.observers) + human_target.observers |= src + human_target.hud_used.show_hud(human_target.hud_used.hud_version, src) var/list/target_contents = human_target.get_contents() //Handles any currently open storage containers the target is looking in when we observe for(var/obj/item/storage/checked_storage in target_contents) - if(!(target in checked_storage.content_watchers)) + if(!(human_target in checked_storage.content_watchers)) continue client.add_to_screen(checked_storage.closer) @@ -289,7 +288,7 @@ break - observe_target_mob = target + observe_target_mob = human_target RegisterSignal(observe_target_mob, COMSIG_PARENT_QDELETING, PROC_REF(clean_observe_target)) RegisterSignal(observe_target_mob, COMSIG_MOB_GHOSTIZE, PROC_REF(observe_target_ghosting)) RegisterSignal(observe_target_mob, COMSIG_MOB_NEW_MIND, PROC_REF(observe_target_new_mind)) @@ -297,8 +296,8 @@ RegisterSignal(src, COMSIG_MOVABLE_MOVED, PROC_REF(observer_move_react)) - if(target.client) - observe_target_client = target.client + if(human_target.client) + observe_target_client = human_target.client RegisterSignal(observe_target_client, COMSIG_CLIENT_SCREEN_ADD, PROC_REF(observe_target_screen_add)) RegisterSignal(observe_target_client, COMSIG_CLIENT_SCREEN_REMOVE, PROC_REF(observe_target_screen_remove)) return