From 7124483f2f5f98561d5e2dad9dc831792d1fb8e6 Mon Sep 17 00:00:00 2001 From: Rhials <28870487+Rhials@users.noreply.github.com> Date: Sun, 23 Jun 2024 17:38:11 -0400 Subject: [PATCH] Admin-only deadchat broadcasts don't repeat the "this is for admins only" message (#84212) ## About The Pull Request This makes it so that, when an admin-only deadchat broadcast is sent, it doesn't add the "this is for admins only" message for every admin in the server. ## Why It's Good For The Game I saw this and it annoyed me and we can do this in a better way. ## Changelog :cl: Rhials fix: Admin-only deadchat broadcasts don't append a second "this message is for admins only" string for every admin online. /:cl: --- code/__HELPERS/mobs.dm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 5237132e4b1..06f81e742ad 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -331,6 +331,9 @@ GLOBAL_LIST_INIT(skin_tone_names, list( /proc/deadchat_broadcast(message, source=null, mob/follow_target=null, turf/turf_target=null, speaker_key=null, message_type=DEADCHAT_REGULAR, admin_only=FALSE) message = span_deadsay("[source][span_linkify(message)]") + if(admin_only) + message += span_deadsay(" (This is viewable to admins only).") + for(var/mob/M in GLOB.player_list) var/chat_toggles = TOGGLES_DEFAULT_CHAT var/toggles = TOGGLES_DEFAULT @@ -341,10 +344,8 @@ GLOBAL_LIST_INIT(skin_tone_names, list( toggles = prefs.toggles ignoring = prefs.ignoring if(admin_only) - if (!M.client?.holder) - return - else - message += span_deadsay(" (This is viewable to admins only).") + if(!M.client?.holder) + continue var/override = FALSE if(M.client?.holder && (chat_toggles & CHAT_DEAD)) override = TRUE