Skip to content

Commit

Permalink
Allow Mentors to Eavesdrop on Mhelps (cmss13-devs#3720)
Browse files Browse the repository at this point in the history
# About the pull request

This PR grants mentors the ability to see other responses to mentor help
messages, and fixes the double messaging if you are responder to the
mhelp.

# Explain why it's good for the game

Mentors can learn from other mentors too!

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>

# Changelog
:cl: Drathek
admin: Mentors can now eavesdrop on mentor messages, and the responder
to a mhelp doesn't get double logging from eavesdropping.
/:cl:
  • Loading branch information
Drulikar committed Jun 27, 2023
1 parent 99b37d9 commit b7afdf5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions code/modules/mentor/mentorhelp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -108,28 +108,28 @@
sound_to(recipient, 'sound/effects/mhelp.ogg')
to_chat(recipient, wrap_message(msg, sender))

for(var/client/C in GLOB.admins)
for(var/client/admin_client in GLOB.admins)
var/formatted = msg
var/soundfile

if(!C || C == recipient)
if(!admin_client || admin_client == recipient)
continue

// Initial broadcast
else if(!staff_only && !recipient && CLIENT_HAS_RIGHTS(C, R_MENTOR))
else if(!staff_only && !recipient && CLIENT_HAS_RIGHTS(admin_client, R_MENTOR))
formatted = wrap_message(formatted, sender)
soundfile = 'sound/effects/mhelp.ogg'

// Staff eavesdrop
else if(CLIENT_HAS_RIGHTS(C, R_MENTOR) && CLIENT_IS_STAFF(C))
// Eavesdrop
else if(CLIENT_HAS_RIGHTS(admin_client, R_MENTOR) && (!staff_only || CLIENT_IS_STAFF(admin_client)) && admin_client != sender)
if(include_keys)
formatted = SPAN_MENTORHELP(key_name(sender, TRUE) + " -> " + key_name(recipient, TRUE) + ": ") + msg

else continue

if(soundfile && with_sound && (C.prefs?.toggles_sound & SOUND_ADMINHELP))
sound_to(C, soundfile)
to_chat(C, formatted)
if(soundfile && with_sound && (admin_client.prefs?.toggles_sound & SOUND_ADMINHELP))
sound_to(admin_client, soundfile)
to_chat(admin_client, formatted)
return

// Makes the sender input a message and sends it
Expand Down

0 comments on commit b7afdf5

Please sign in to comment.