From ffb7bb55c746ef01f74bc9cc80ba355d045f1705 Mon Sep 17 00:00:00 2001 From: ynot01 Date: Fri, 13 May 2022 18:26:29 -0400 Subject: [PATCH 1/4] dchat broadcast proper --- yogstation/code/modules/antagonists/darkspawn/darkspawn.dm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/yogstation/code/modules/antagonists/darkspawn/darkspawn.dm b/yogstation/code/modules/antagonists/darkspawn/darkspawn.dm index f9ac2aa576c5..06ca1495cf7b 100644 --- a/yogstation/code/modules/antagonists/darkspawn/darkspawn.dm +++ b/yogstation/code/modules/antagonists/darkspawn/darkspawn.dm @@ -335,8 +335,7 @@ var/processed_message = span_velvet("\[Mindlink\] [H.real_name] has not divulged in time and is now forcefully divulging.") for(var/mob/M in GLOB.player_list) if(M.stat == DEAD) - var/link = FOLLOW_LINK(M, H) - to_chat(M, "[link] [processed_message]") + deadchat_broadcast(processed_message, null, H) else if(isdarkspawn(M)) to_chat(M, processed_message) addtimer(CALLBACK(src, .proc/divulge), 25) From ba4de6abce56abc14ef0c120cb7c4d80e5ca99a4 Mon Sep 17 00:00:00 2001 From: ynot01 Date: Fri, 13 May 2022 18:40:36 -0400 Subject: [PATCH 2/4] cleaning up bad "send to world" code instead of "to_chat(world" use send_to_playing_players instead of SEND_SOUND to everyone that exists use sound_to_playing_players and use debug_world instead of random "to_chat(world" in the case that something goes wrong... --- code/game/objects/items/plushes.dm | 2 +- .../clock_structures/ratvar_the_clockwork_justicar.dm | 4 ++-- code/modules/security_levels/security_levels.dm | 6 +++--- yogstation/code/modules/admin/admin_verbs.dm | 2 +- yogstation/code/modules/antagonists/darkspawn/darkspawn.dm | 3 +-- .../modules/antagonists/shadowling/ascendant_shadowling.dm | 4 ++-- .../antagonists/shadowling/special_shadowling_abilities.dm | 5 ++--- .../code/modules/guardian/abilities/special/pocket.dm | 2 +- 8 files changed, 13 insertions(+), 15 deletions(-) diff --git a/code/game/objects/items/plushes.dm b/code/game/objects/items/plushes.dm index e5deec0f2b77..badea517cf36 100644 --- a/code/game/objects/items/plushes.dm +++ b/code/game/objects/items/plushes.dm @@ -215,7 +215,7 @@ /obj/item/toy/plush/proc/heartbreak(obj/item/toy/plush/Brutus) if(lover != Brutus) - to_chat(world, "lover != Brutus") + debug_world("lover != Brutus") return //why are we considering someone we don't love? scorned.Add(Brutus) diff --git a/code/modules/antagonists/clockcult/clock_structures/ratvar_the_clockwork_justicar.dm b/code/modules/antagonists/clockcult/clock_structures/ratvar_the_clockwork_justicar.dm index 96dc92926d3a..c95a8c67cb5c 100644 --- a/code/modules/antagonists/clockcult/clock_structures/ratvar_the_clockwork_justicar.dm +++ b/code/modules/antagonists/clockcult/clock_structures/ratvar_the_clockwork_justicar.dm @@ -105,8 +105,8 @@ return clashing = TRUE GLOB.cult_narsie.clashing = TRUE - to_chat(world, "\"YOU.\"") - to_chat(world, "\"Ratvar?!\"") + send_to_playing_players("\"YOU.\"") + send_to_playing_players("\"Ratvar?!\"") clash_of_the_titans(GLOB.cult_narsie) // >:( return TRUE diff --git a/code/modules/security_levels/security_levels.dm b/code/modules/security_levels/security_levels.dm index f26fa0c62858..daf5b60f5879 100644 --- a/code/modules/security_levels/security_levels.dm +++ b/code/modules/security_levels/security_levels.dm @@ -56,7 +56,7 @@ GLOBAL_VAR_INIT(security_level, SEC_LEVEL_GREEN) if(SEC_LEVEL_GAMMA) minor_announce(CONFIG_GET(string/alert_gamma), "Attention! Gamma security level activated!", TRUE) - SEND_SOUND(world, 'sound/misc/gamma_alert.ogg') + sound_to_playing_players('sound/misc/gamma_alert.ogg') if(GLOB.security_level == SEC_LEVEL_GREEN) modTimer = 0.25 else if(GLOB.security_level == SEC_LEVEL_BLUE) @@ -66,8 +66,8 @@ GLOBAL_VAR_INIT(security_level, SEC_LEVEL_GREEN) if(SEC_LEVEL_EPSILON) minor_announce(CONFIG_GET(string/alert_epsilon), "Attention! Epsilon security level reached!", TRUE) - SEND_SOUND(world, 'sound/misc/epsilon_alert.ogg') - to_chat(world, span_notice("You get a bad feeling as you hear the Epsilon alert siren.")) + sound_to_playing_players('sound/misc/epsilon_alert.ogg') + send_to_playing_players(span_notice("You get a bad feeling as you hear the Epsilon alert siren.")) if(GLOB.security_level < SEC_LEVEL_EPSILON) modTimer = 1 diff --git a/yogstation/code/modules/admin/admin_verbs.dm b/yogstation/code/modules/admin/admin_verbs.dm index 8caf8e78a490..cf610cff3d07 100644 --- a/yogstation/code/modules/admin/admin_verbs.dm +++ b/yogstation/code/modules/admin/admin_verbs.dm @@ -23,7 +23,7 @@ var/fluff_revive = pick("revive","rejuvenate","rekindle","renew","restore","resuscitate","revitalize","repair") var/fluff_everyone = pick("everyone","every single one of you","the populace","the masses","each person","anybody and everybody","every player","all the greytiders","all the wonderful individuals") - to_chat(world, "[fluff_the] [fluff_adjective] [fluff_admins] have [fluff_decide] to [fluff_adverb] [fluff_revive] [fluff_everyone]. :)") + send_to_playing_players("[fluff_the] [fluff_adjective] [fluff_admins] have [fluff_decide] to [fluff_adverb] [fluff_revive] [fluff_everyone]. :)") message_admins("[src] revived [revive_count] mobs.") log_admin("[src] revived [revive_count] mobs.") diff --git a/yogstation/code/modules/antagonists/darkspawn/darkspawn.dm b/yogstation/code/modules/antagonists/darkspawn/darkspawn.dm index 06ca1495cf7b..65f1cc527d60 100644 --- a/yogstation/code/modules/antagonists/darkspawn/darkspawn.dm +++ b/yogstation/code/modules/antagonists/darkspawn/darkspawn.dm @@ -368,8 +368,7 @@ addtimer(CALLBACK(src, .proc/sacrament_shuttle_call), 50) for(var/V in abilities) remove_ability(abilities[V], TRUE) - for(var/mob/M in GLOB.player_list) - M.playsound_local(M, 'yogstation/sound/magic/sacrament_complete.ogg', 70, FALSE, pressure_affected = FALSE) + sound_to_playing_players('yogstation/sound/magic/sacrament_complete.ogg', 70, FALSE, pressure_affected = FALSE) psi = 9999 psi_cap = 9999 psi_regen = 9999 diff --git a/yogstation/code/modules/antagonists/shadowling/ascendant_shadowling.dm b/yogstation/code/modules/antagonists/shadowling/ascendant_shadowling.dm index c352c479517d..2be8e231e6a0 100644 --- a/yogstation/code/modules/antagonists/shadowling/ascendant_shadowling.dm +++ b/yogstation/code/modules/antagonists/shadowling/ascendant_shadowling.dm @@ -40,9 +40,9 @@ /mob/living/simple_animal/ascendant_shadowling/singularity_act() to_chat(src, "\"VYSHA NERADA YEKHEZET U'RUU!!\"") - for(var/mob/M in GLOB.player_list) - SEND_SOUND(M, sound('sound/hallucinations/veryfar_noise.ogg')) + send_to_playing_players("\"VYSHA NERADA YEKHEZET U'RUU!!\"") + sound_to_playing_players('sound/hallucinations/veryfar_noise.ogg') for(var/obj/machinery/power/apc/A in GLOB.apcs_list) A.overload_lighting() SSachievements.unlock_achievement(/datum/achievement/greentext/slingascend, H.client) diff --git a/yogstation/code/modules/guardian/abilities/special/pocket.dm b/yogstation/code/modules/guardian/abilities/special/pocket.dm index 894c785c558e..94e5b54903a9 100644 --- a/yogstation/code/modules/guardian/abilities/special/pocket.dm +++ b/yogstation/code/modules/guardian/abilities/special/pocket.dm @@ -26,7 +26,7 @@ GLOBAL_LIST_EMPTY(pocket_mirrors) . = ..() var/datum/space_level/level = SSmapping.get_level(z) if (!level) - to_chat(world, "uh oh, stinky!!") + debug_world("uh oh, stinky!!") return INITIALIZE_HINT_QDEL GLOB.pocket_corners[level.name] = list( "bl-corner" = get_turf(src), // Bottom left corner From cdc6bc1dfee94814e6ddbfbabd580912c72cddad Mon Sep 17 00:00:00 2001 From: ynot01 Date: Fri, 13 May 2022 18:54:57 -0400 Subject: [PATCH 3/4] would have spammed dchat 50 times --- yogstation/code/modules/antagonists/darkspawn/darkspawn.dm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/yogstation/code/modules/antagonists/darkspawn/darkspawn.dm b/yogstation/code/modules/antagonists/darkspawn/darkspawn.dm index 65f1cc527d60..0957553f5fa5 100644 --- a/yogstation/code/modules/antagonists/darkspawn/darkspawn.dm +++ b/yogstation/code/modules/antagonists/darkspawn/darkspawn.dm @@ -334,10 +334,9 @@ H.do_jitter_animation(1000) var/processed_message = span_velvet("\[Mindlink\] [H.real_name] has not divulged in time and is now forcefully divulging.") for(var/mob/M in GLOB.player_list) - if(M.stat == DEAD) - deadchat_broadcast(processed_message, null, H) - else if(isdarkspawn(M)) + if(M.stat != DEAD && isdarkspawn(M)) to_chat(M, processed_message) + deadchat_broadcast(processed_message, null, H) addtimer(CALLBACK(src, .proc/divulge), 25) addtimer(CALLBACK(/atom/.proc/visible_message, H, span_boldwarning("[H]'s skin sloughs off, revealing black flesh covered in symbols!"), \ span_userdanger("You have forcefully divulged!")), 25) From 24d1b800c1a5ba49bca17786afdd603743ab7327 Mon Sep 17 00:00:00 2001 From: ynot01 Date: Fri, 13 May 2022 18:57:21 -0400 Subject: [PATCH 4/4] debug_admins instead of debug_world --- code/game/objects/items/plushes.dm | 2 +- yogstation/code/modules/guardian/abilities/special/pocket.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/plushes.dm b/code/game/objects/items/plushes.dm index badea517cf36..867b89a4d783 100644 --- a/code/game/objects/items/plushes.dm +++ b/code/game/objects/items/plushes.dm @@ -215,7 +215,7 @@ /obj/item/toy/plush/proc/heartbreak(obj/item/toy/plush/Brutus) if(lover != Brutus) - debug_world("lover != Brutus") + debug_admins("lover != Brutus") return //why are we considering someone we don't love? scorned.Add(Brutus) diff --git a/yogstation/code/modules/guardian/abilities/special/pocket.dm b/yogstation/code/modules/guardian/abilities/special/pocket.dm index 94e5b54903a9..f4a92aac025c 100644 --- a/yogstation/code/modules/guardian/abilities/special/pocket.dm +++ b/yogstation/code/modules/guardian/abilities/special/pocket.dm @@ -26,7 +26,7 @@ GLOBAL_LIST_EMPTY(pocket_mirrors) . = ..() var/datum/space_level/level = SSmapping.get_level(z) if (!level) - debug_world("uh oh, stinky!!") + debug_admins("uh oh, stinky!!") return INITIALIZE_HINT_QDEL GLOB.pocket_corners[level.name] = list( "bl-corner" = get_turf(src), // Bottom left corner