Skip to content

Commit

Permalink
[MIRROR] Makes robotic talk use GetVoice for carbons, fixing voice ch…
Browse files Browse the repository at this point in the history
…anger issue (#2854)

* 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:

* (upstream PR 81901)

---------

Co-authored-by: _0Steven <[email protected]>
  • Loading branch information
NaakaKo and 00-Steven authored Mar 12, 2024
1 parent 5709dd4 commit 530b025
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions code/modules/mob/living/silicon/silicon_say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@
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))
to_chat(
M,
span_binarysay("\
Robotic Talk, \
<a href='?src=[REF(M)];track=[html_encode(name)]'>[span_name("[name] ([designation])")]</a> \
<a href='?src=[REF(M)];track=[html_encode(namepart)]'>[span_name("[namepart] ([designation])")]</a> \
<span class='message'>[quoted_message]</span>\
"),
avoid_highlighting = src == M
Expand All @@ -37,7 +42,7 @@
M,
span_binarysay("\
Robotic Talk, \
[span_name("[name]")] <span class='message'>[quoted_message]</span>\
[span_name("[namepart]")] <span class='message'>[quoted_message]</span>\
"),
avoid_highlighting = src == M
)
Expand All @@ -59,7 +64,7 @@
span_binarysay("\
[follow_link] \
Robotic Talk, \
[span_name("[name]")] <span class='message'>[quoted_message]</span>\
[span_name("[namepart]")] <span class='message'>[quoted_message]</span>\
"),
avoid_highlighting = src == M
)
Expand Down

0 comments on commit 530b025

Please sign in to comment.