From 88efc67db9beef70ae4bd401fefa27f35c6a5e25 Mon Sep 17 00:00:00 2001
From: SkyratBot <59378654+SkyratBot@users.noreply.github.com>
Date: Sun, 10 Mar 2024 01:29:57 +0100
Subject: [PATCH] [MIRROR] Makes robotic talk use GetVoice for carbons, fixing
voice changer issue (#26822)
* Makes robotic talk use GetVoice for carbons, fixing voice changer issue (#81901)
## About The Pull Request
I noticed that when using a chameleon set and agent ID to change my
voice and then using the binary encryption key to talk over binary, it
would actually show as "Real Name (as ID)" rather than "ID" as expected.
Looking into the code, this seemed to be because robotic talk would use
`name` rather than getting the voice of the speaker, which is set to the
*visible name* of the speaker, leading to it using the visible name
rather than their voice.
This pr changes it to use `GetVoice` to have a result consistent with
regular comms.
## Why It's Good For The Game
When you use a chameleon mask with an agent ID it lets you mask your
voice over comms even if your face isn't fully covered, it's your voice
after all, but over robotic comms it cares about your visible name
rather than your voice even though you're still talking into a headset.
This pr makes it consistent with the behaviour of voice changing over
regular comms.
## Changelog
:cl:
fix: When a carbon talks over robotic it uses their voice instead of
visible name. Meaning, voice changers work like they do over other comms
regardless of face covering.
/:cl:
* Makes robotic talk use GetVoice for carbons, fixing voice changer issue
---------
Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com>
---
code/modules/mob/living/silicon/silicon_say.dm | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/code/modules/mob/living/silicon/silicon_say.dm b/code/modules/mob/living/silicon/silicon_say.dm
index 54c4a4f82d1..4592097dfa8 100644
--- a/code/modules/mob/living/silicon/silicon_say.dm
+++ b/code/modules/mob/living/silicon/silicon_say.dm
@@ -17,6 +17,11 @@
spans
)
+ var/namepart = name
+ // If carbon, use voice to account for voice changers
+ if(iscarbon(src))
+ namepart = GetVoice()
+
for(var/mob/M in GLOB.player_list)
if(M.binarycheck())
if(isAI(M))
@@ -24,7 +29,7 @@
M,
span_binarysay("\
Robotic Talk, \
- [span_name("[name] ([designation])")] \
+ [span_name("[namepart] ([designation])")] \
[quoted_message]\
"),
avoid_highlighting = src == M
@@ -34,7 +39,7 @@
M,
span_binarysay("\
Robotic Talk, \
- [span_name("[name]")] [quoted_message]\
+ [span_name("[namepart]")] [quoted_message]\
"),
avoid_highlighting = src == M
)
@@ -56,7 +61,7 @@
span_binarysay("\
[follow_link] \
Robotic Talk, \
- [span_name("[name]")] [quoted_message]\
+ [span_name("[namepart]")] [quoted_message]\
"),
avoid_highlighting = src == M
)