Skip to content

Commit

Permalink
fira
Browse files Browse the repository at this point in the history
  • Loading branch information
Doubleumc committed Nov 12, 2023
1 parent dbad40d commit ddef7b5
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions code/modules/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -248,33 +248,32 @@
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)
reset_perspective()

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)
Expand All @@ -289,16 +288,16 @@

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))
RegisterSignal(observe_target_mob, COMSIG_MOB_LOGIN, PROC_REF(observe_target_login))

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
Expand Down

0 comments on commit ddef7b5

Please sign in to comment.