From 4cddf3c859ff5528e2579dbd351b57ea1d5219ed Mon Sep 17 00:00:00 2001 From: Matt Atlas Date: Fri, 8 May 2020 12:57:40 +0200 Subject: [PATCH] Allows ghosts to see visible_messages. (#8806) Allows ghosts to see visible_messages --- .../modules/mob/abstract/observer/observer.dm | 4 +- code/modules/mob/mob.dm | 4 +- html/changelogs/mattatlas-ghostmessages.yml | 41 +++++++++++++++++++ 3 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 html/changelogs/mattatlas-ghostmessages.yml diff --git a/code/modules/mob/abstract/observer/observer.dm b/code/modules/mob/abstract/observer/observer.dm index 054d18904f6..260397472e3 100644 --- a/code/modules/mob/abstract/observer/observer.dm +++ b/code/modules/mob/abstract/observer/observer.dm @@ -907,11 +907,11 @@ mob/abstract/observer/MayRespawn(var/feedback = 0, var/respawn_type = null) /mob/extra_ghost_link(var/atom/ghost) if(client && eyeobj) - return "|\[E\]" + return "|\[E\]" /mob/abstract/observer/extra_ghost_link(var/atom/ghost) if(mind && mind.current) - return "|\[B\]" + return "|\[B\]" /proc/ghost_follow_link(var/atom/target, var/atom/ghost) if((!target) || (!ghost)) return diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index a754605eced..cd09f499ae2 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -124,11 +124,13 @@ continue if (!M.client || istype(M, /mob/abstract/new_player)) continue - if(get_turf(M) in messageturfs) + if((get_turf(M) in messageturfs) || (isobserver(M) && (M.client.prefs.toggles & CHAT_GHOSTSIGHT))) messagemobs += M for(var/A in messagemobs) var/mob/M = A + if(isobserver(M)) + M.show_message("[ghost_follow_link(src, M)] [message]", 1) if(self_message && M==src) M.show_message(self_message, 1, blind_message, 2) else if(M.see_invisible < invisibility) // Cannot view the invisible, but you can hear it. diff --git a/html/changelogs/mattatlas-ghostmessages.yml b/html/changelogs/mattatlas-ghostmessages.yml new file mode 100644 index 00000000000..101dd1f348d --- /dev/null +++ b/html/changelogs/mattatlas-ghostmessages.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: MattAtlas + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Ghosts can now see visible messages such as surgery messages. This is affected by the ghostsight preference."